Fix SET_FAIL macro.
Implement non-blocking I/O on Windows.