Fix data race in logging system.
Fix data race in Conection::Receive.