Release locks on error in `Balance.gather`.

Closes #282.