Never hold a mutex longer than necessary.

Thanks to go's error handling without exceptions, there is not even a
hidden dangerous code-path not unlocking the mutex here. yay.