Fix stat/lstat error checking in a few places.

closes #6929. Please review.
I'm trying to figure out how but I don't really see a way. the Lstat is deliberately checking if the symlink references a non-existent file after the Stat call fails. I think I could nest them if you wanted, which should eliminate one stat call for every file. Should be a significant perf increase for large numbers of files.