Stat the link itself instead of file it refers to

If path is a symbolic link and target doesn't exist, we may incorrectly through
file not found exception. This changes fixes the issue by using File.lstat to
stat the path.