Fix stat/lstat error checking in a few places.

closes #6929. Please review.
You return nil, if it is a symlink. It should be
```
if err != nil {
  return err
}
if [symlink] {
  return fmt.Errorf("ValidateContextDirectory: %s is a symlink", filePath)
}
```