Fix hunkends[] calculation in PatchTryApply

This was broken when "patch --dry-run" reported a failed hunk for the
last hunk in a not-last file.