Moves chainstate initialization into its own function. This is
necessary to later support a more readable way of handling
background-validation chainstate cleanup during init, since the
chainstate initialization functions may need to be repeated after
moving leveldb filesystem content around.
This commit isn't strictly necessary, but the alternative is to (ab)use
the while loop in init.cpp with a continue on the basis of a
specific ChainstateLoadingError return value from LoadChainstate. Not
only is this harder to read, but it can't be unittested.
The approach here lets us consolidate background-validation cleanup to
LoadChainstate, and therefore exercise it within tests.
This commit is most easily reviewed with
git diff --color-moved=dimmed-zebra --color-moved-ws=ignore-space-change
This is a partial backport of core#25740
https://github.com/bitcoin/bitcoin/pull/25740/commits/f2a4f3376f1476b38a79a549bd81ba3006225df6
Depends on D14685