Apply stat fix for mingw. It's ugly, it's implausible, but it seems to work. Unlike Cygwin...(missing no. 3).