in dir_lookup (used by vfs functions), first try to match directory names before file names, so that we can lookup entries that are subpaths of the directory path even if another file with the same name exists.