Fix bug where the mutex was still locked when deleting the measure.