Release the lock *after* calling notify_one(), to cause a quicker wakeup for ThreadMessageHandler