Correctly return Windows read/write error codes during timeout/blocking calls.
Continuation of last commit.