Release locks on error in `mergeBranches`.

Closes #276.