Simplify write waiter handling
Writer threads do their own wait using select/poll instead of asking the listener thread. Eliminates one mutex+one condvar per conn plus multiple wakeups of the listener thread. Also fixes writetimeout to wait an exact time, instead of the approximation used in the listener thread.