to remote host was refused. FreeBSD connect(2) call returns EINVAL in
that case and clears the error code, so there's no way to determine
what happened. Reimplement ruby_connect via select call instead of
polling the status by connect(2). This may also reduce overhead (though,
not verified).
Reported by: Saku Ytti <saku@ytti.fi>