lstat_cache(): introduce has_dirs_only_path() function