lockfree: use lock_guard instead of the deprecated boost::mutex::scoped_lock

fixes #8838