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