Also make sure the mutex unlocks

Otherwise deadlock