Assert all locks freed in `chooseBranchesToMerge`.

See #262.