TRQ-1830. Properly interpret the errno obtained in socket_wait_for_write().