The detect_headers_and_footers function was incrementing classified_count
every time a block was classified, even if it was already classified from
a previous sliding window iteration. With 10 pages and identical headers,
blocks on pages 1-9 would be reclassified multiple times (31 classifications
instead of 10).
Fixed by checking if block is already "header" or "footer" before incrementing
the counter.
All 25 header_footer tests now pass.
Refs: pdftract-2j4zl
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>