implement socket timeout on connect
before this, we could have hung connecting to unavailable servers for
essentially ever. we only set SO_SNDTIMEO (not SO_RCVTIMEO) as we only
care when packets we send don't get ACKed in time (more specifically, we
only care about the server ACKing our initial SYN), not when the server
stops sending data for a while (the latter we handle using PING/PONG
ourselves).
c.f. https://stackoverflow.com/a/
4182564. should cause EINPROGRESS for
connect(2), EAGAIN or EWOULDBLOCK otherwise.