Keep mutex locked when exiting.