merge: be more careful about aligning hunk-headers with newlines.
When matching a diff to a file, it would be very confusing.
if the last match from one hunk were on the same line of the
original as the first match of the next hunk.
So we try to align hunk-headers with newlines.
In particular, we often find Unmatched and Extraneous
sections together. There can be encoded in any order.
If the Extraneous section contains a hunk-header,
we want to make sure that if there is a newline anywhere
in the unmatched section, then the Unmatched that is placed
before the hunk-headers Extraneous ends on a newline.
There was code the attempted this, but it was too simplistic
and would sometimes move outside the regions that it should
have been examine, which would lead to various bugs.
The tests case which demonstrated this is added to the
test suite.
Reported-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: NeilBrown <neilb@suse.de>