Correctly handle a writable->unwritable transition on a socket in kevent.