Fix TcpAppender to be thread safe.