fix mingw stat() and lstat() implementations for handling symlinks