This is a partial backport of core#26762
https://github.com/bitcoin/bitcoin/pull/26762/changes/be4ff3060b7b43b496dfb5a2c02b114b2b717106
Note:
- See D521 for the code difference with the source material (we don't have a parallel_script_checks flag)
- The diff introduces a ~ChainstateManager destructor that is removed again in the next commit