Add lock to protect Modifing tcp_server_exit value.