MinGW: fix stat() and lstat() implementations for handling symlinks