Fix the a mutex deadlog in the log library.