Emacs will searching file with a suffix even the dir is not exists.
For example, (add-to-list 'load-path "/path-not-exists"), then (require 'debug) will lead searching the debug.dll/debug.elc/debug.el under the "/path-not-exists" on windows.

This patch will distinguish the non-exists-dir to skip the unnecessary file operations.