This is a preparatory commit for removing the header hash
caching in the CBlockHeader class. In order to not lose the
old block hash, necessary for updating the internal state of
the test (represented by self.block_heights and self.blocks),
we should only modify it within the update_block method.
This is a partial backport of core#32868
https://github.com/bitcoin/bitcoin/pull/32868/commits/0f044e82bd5fe116a5e3560346ac78da9c9a6e54
Depends on D18735