Stat the link itself instead of file it refers to

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