Instead of unlocking at the end of the function, just `defer ldbe.CountMutex.Unlock()` instead.