Flush output buffers in the tap reader thread on Windows.

This is basically a port of commit 50fcfea1 to 1.1.