Move handling of unconnecting headers into own function
Summary:
This introduces a minor change in the misbehavior score: previously a non-connecting non-continuous header sequence of size MAX_BLOCKS_TO_ANNOUNCE+1 was assigned 20 (non-continuous headers sequence), now it is assigned 10 (invalid header received).
The behavior is unchanged if the number of headers is <= MAX_BLOCKS_TO_ANNOUNCE.
This is a partial backport of core#25454
https://github.com/bitcoin/bitcoin/pull/25454/commits/7f2450871b3ea0b4d02d56bd2ca365fcc25cf90e
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D14906