TS-1475: Fix leaking sockets in LogSock.cc.