Make log threadsafe.