moved socket creation to synchronized method

@gsoltis this should fix the race condition that occurred when closing the socket while connecting
Why not just synchronize the underlying send, rather than each public caller?