A few locking fixes in the class Logger.