Idiomatic go: use defer for mutex unlocks.