Issues #23808, #25911: Trying to fix walk tests on Windows.

On Windows a symlink can has the FILE_ATTRIBUTE_DIRECTORY flag.