index: Commit DB_MUHASH and DB_BEST_BLOCK to disk together
Summary:
If these are written to disk at different times unclean shutdowns can lead to index corruption.
Add coinstatsindex_unclean_shutdown test
This is a backport of core#24138
Depends on D13912
Notes:
- since D2127 removed the block index as an output parameter of AcceptBlock, we need some additional code in the test to fetch it from the block index.
- src/test/util/validation.{h|cpp} need to be created since we didn't yet backport core#20332
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D13913