Code Reviewer Notes
Call graph of relevant functions:
UnloadBlockIndex() <-- Moved from
calls ChainstateManager::Unload()
which calls BlockManager::Unload() <-- Moved to
So calling UnloadBlockIndex() would still run this moved code. The code
will also now run when ~BlockManager gets called, which makes sense.
This is a partial backport of core#24909
https://github.com/bitcoin/bitcoin/pull/24909/commits/a4014021258319941716d6338c18667462a06280
Depends on D13046