Merge pull request #2831 from ethomson/merge_lock merge: lock index during the merge (not just checkout)