chore(*): replace unique_lock with lock_guard when we do not need to use conditional variables

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
chore(*): replace unique_lock with lock_guard when we do not need to use conditional variables