Add unit test for HeadersSyncState
Summary:
This is a partial backport of core#25717
https://github.com/bitcoin/bitcoin/pull/25717/commits/0b6aa826b53470c9cc8ef4a153fa710dce80882f
Depends on D15164
Test Plan: ninja check
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D15165