mergestate: use an early return for trivial merges
`filemerge.filemerge()` returns `None` if no merge was needed because
the two sides were identical. I'd like to move that to the
caller. This is a little refactoring to prepare for that.
Differential Revision: https://phab.mercurial-scm.org/D12153