Upgrade patch to detect hunks that start after a false start.

Imagine a hunk that starts with a blank line, but the site to patch starts
with two blank lines.  Before we'd read the first blank line, think it was the
start of the hunk and buffer it, read the second blank line, notice that it
didn't match the second line of the hunk, and discard _both_ buffered lines of
context (writing them to the output file) without checking that one of the
later context lines might have been the real start of the hunk.

Make it re-check the rest of the buffered context for matches each time it
discards a line of buffered context.
3 files changed