Deal with Windows FD_WRITE issue

Windows does not fire FD_WRITE event like in UNIX. It is only fired
after a socket is newly connected via a connect or accept and after a
write call failed due to potential blocking.
Change IO style to make it work in Windows

- When a write to client or server is scheduled, write immediately if
possible.
- If we can not do a read because a write on the other end of the
channel is pending, then do a dummy 0 byte read. This is needed for the
read event to fire again in Windows.
Be selective about requesting FD_READ event

Do not request FD_READ event to be fired when a write is pending on the
end. In Windows, this avids the need to make dummy 0 byte recv call to
reenable the FD_READ event if we are unable to do an actual read while
write is pending on the other end of the channel. In both UNIX and
Windows, this approach should improve performance by reducing the need
for read events when not appropriate.

Bottom line, now a FD_READ event will fire only when we are actually
ready to read from the socket and no write is pending on the other end.