Fix diff patch line number calculation

This was just being calculated wrong.  Added a test that verifying patch line numbers even for hunks further into a file and then fixed the algorithm.  I needed to add a little extra state into the patch so that I could track old and new file numbers independently, but it should be okay.

This should fix #1225