Use stat on Windows since lstat is not defined because there are no
symlinks on Windows.