nanosleep: improve port to mingw