Fix std::lock_guard life-time issue
As the std::lock_guard instance had no name, it was destroyed at the end of the statement instead of the end of the method.
Edited by François Grisez
As the std::lock_guard instance had no name, it was destroyed at the end of the statement instead of the end of the method.