Wait for socket to become writable.