add missing mutex_lock and mutex_unlock in sync_queue