Cleanup some logic in PatchTryApply

Checking both fname and hnum is redundant.
Fix off-by-one error in PatchTryApply

which broke detecting fuzz in the last hunk of a non-last file.
Use matchstr() more effectively

it has a 'count' parameter which is actually what we want to use.
Fix list out of bounds error with small hunks

which have less than 3 context lines