log_error(): Reduce the mutex-protected area