Create our own socket connections

This allows the user to set the socket options before the connection is
established. The previous approach of setting the options after the connection
was established was not correct.
I don't believe SO_REUSEADDR needs to be set before bind.

For outbound connections you need a unique 5-tuple of (family, local ip, local port, remote ip, remote port). The remote ip and remote port don't come until you call `connect`, so I don't believe that we can throw the EADDRINUSE error until `connect` is called.

I'm open to being proved wrong, but I'd like someone to prove it first (ideally with a small test case).