Socket leaking on connection errors fixed