[META] No behaviour change is intended in this commit.
[META] This commit should be followed up by removing the comments and assertions meant only to show that the change is correct.
Also stop FindFilesToPrune{,Manual} from unnecessary reaching for
::ChainActive() by passing in the necessary information.
Backport note: forward declaration of class CChainState was necessary for declaring this class friend of BlockManager.
This is a backport of core#19927 [4/6]
https://github.com/bitcoin/bitcoin/pull/19927/commits/3f5b5f3f6db0e5716911b3fba1460ce327e8a845#
Depends on D9822