tcp-client: do not leak sockets