Fix memory leak when --tcpout is used