Until now, the program
import System.IO main = hWaitForInput stdin (5 * 1000)
didn't wait 5 seconds for input on Winodws, it terminated immediately.
This was because the PeekNamedPipe() function introduced
in commit 94fee9e7 really only peeks, it doesn't block.
So if there's no data, fdReady(fd, msec) would return immediately
even when the given msec timeout is not zero.
This commit fixes it by looping around PeekNamedPipe()
with a sleep(1 ms).
Apparently there's no better way to do this on Windows
without switching to IOCP.
In any case, this change should be strictly better than
what was there before.