Steps to reproduce:

* Create a datadir that is pruned
* Start with `-prune=550 -reindex-chainstate`
* Hangs with idle CPU

(`-reindex` works)
if (node.connman) node.connman->Stop();
    StopTorControl();
    
    
    if (node.scheduler) node.scheduler->stop();
    if (node.chainman && node.chainman->m_load_block.joinable()) node.chainman->m_load_block.join();
    StopScriptCheckWorkerThreads();
    
    
    node.peerman.reset();
    node.connman.reset();
    node.banman.reset();
    node.addrman.reset();
    if (node.mempool && node.mempool->IsLoaded() && node.args->GetBoolArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
        DumpMempool(*node.mempool);
    }
    
    if (node.fee_estimator) node.fee_estimator->Flush();
    
    if (node.chainman) {
        LOCK(cs_main);
        for (CChainState* chainstate : node.chainman->GetAll()) {
            if (chainstate->CanFlushToDisk()) {
                chainstate->ForceFlushStateToDisk();
            }
        }
    }
    
    
    GetMainSignals().FlushBackgroundCallbacks();