Allow specifying connection timeout in socket options

Since `connect()` does not return the socket instance, there is currently no easy way to set the connection timeout. This PR adds a `timeout` option to the socket options passed to `connect()`, and automatically sets it on the socket when connecting. If a timeout is reached, it will trigger the connect callback with an error.

This should solve #88 .