test: avoid unneeded block header hash -> integer conversions
Summary:
This concludes backport of core#32868
https://github.com/bitcoin/bitcoin/pull/32868/commits/5fa34951ead2eebcced919537f5e27526f61d909
Depends on D18741
Test Plan: ninja check-functional
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D18742