Locate paired file headers immediately preceding a hunk.
A ---/+++ pair is only a file header when it appears outside a hunk
body — a diff of a file that itself contains such lines would otherwise
have its content mistaken for metadata. That is why this walks the hunks'
declared old/new line budgets instead of just matching on the prefix.