Set nonblock on TCP client sockets
Should probably set non-blocking socket options before calling listen
Set nonblock after calling connect, else it returns immediately
Some function calls are deprecated on OS X.