Fix fast-shutdown crash if genesis block was not loaded
Fix fast-shutdown crash if genesis block was not loaded

If the ShutdownRequested() check at the top of ActivateBestChain()
returns false during initial genesis block load we will fail an
assertion in UTXO DB flush as the best block hash IsNull(). To work
around this, we move the check until after one round of
ActivateBestChainStep(), ensuring the genesis block gets connected.

Github-Pull: #12367
Rebased-From: dd2de47c6288654abb2c3eef29edcd1cc5f39fc9
Tree-SHA512: c2465be25aee327d16d460c9b58d25a5aeedec309f539898e78419bea76dbbe9cde9cc88ec393af38a82e6013d71cce85f4223c9bf04e7244ed619f20f734aa4

starwels/starwels,GroestlCoin/bitcoin,myriadteam/myriadcoin,starwels/starwels,peercoin/peercoin,tecnovert/particl-core,digibyte/digibyte,starwels/starwels,peercoin/peercoin,myriadteam/myriadcoin,DigitalPandacoin/pandacoin,1185/starwels,1185/starwels,GroestlCoin/GroestlCoin,GroestlCoin/GroestlCoin,MazaCoin/maza,tecnovert/particl-core,myriadcoin/myriadcoin,ppcoin/ppcoin,gjhiggins/vcoincore,peercoin/peercoin,myriadcoin/myriadcoin,1185/starwels,particl/particl-core,viacoin/viacoin,tecnovert/particl-core,myriadcoin/myriadcoin,tecnovert/particl-core,DigitalPandacoin/pandacoin,MazaCoin/maza,deeponion/deeponion,digibyte/digibyte,qtumproject/qtum,starwels/starwels,GroestlCoin/GroestlCoin,tecnovert/particl-core,myriadcoin/myriadcoin,ahmedbodi/vertcoin,particl/particl-core,gjhiggins/vcoincore,peercoin/peercoin,particl/particl-core,GroestlCoin/bitcoin,1185/starwels,particl/particl-core,digibyte/digibyte,DigitalPandacoin/pandacoin,1185/starwels,DigitalPandacoin/pandacoin,particl/particl-core,peercoin/peercoin,GroestlCoin/GroestlCoin,MazaCoin/maza,vertcoin/vertcoin,myriadteam/myriadcoin,DigitalPandacoin/pandacoin,myriadcoin/myriadcoin,digibyte/digibyte,1185/starwels,particl/particl-core,qtumproject/qtum,ahmedbodi/vertcoin,ahmedbodi/vertcoin,gjhiggins/vcoincore,gjhiggins/vcoincore,viacoin/viacoin,vertcoin/vertcoin,GroestlCoin/GroestlCoin,GroestlCoin/bitcoin,DigitalPandacoin/pandacoin,ahmedbodi/vertcoin,qtumproject/qtum,GroestlCoin/GroestlCoin,myriadteam/myriadcoin,myriadcoin/myriadcoin,qtumproject/qtum,myriadteam/myriadcoin,qtumproject/qtum,deeponion/deeponion,peercoin/peercoin,viacoin/viacoin,ppcoin/ppcoin,qtumproject/qtum,ahmedbodi/vertcoin,deeponion/deeponion,gjhiggins/vcoincore,vertcoin/vertcoin,gjhiggins/vcoincore,vertcoin/vertcoin,ahmedbodi/vertcoin,MazaCoin/maza,viacoin/viacoin,starwels/starwels,deeponion/deeponion,ppcoin/ppcoin,qtumproject/qtum,myriadteam/myriadcoin,digibyte/digibyte,starwels/starwels,tecnovert/particl-core,MazaCoin/maza,vertcoin/vertcoin,GroestlCoin/bitcoin,viacoin/viacoin,ppcoin/ppcoin,MazaCoin/maza,deeponion/deeponion,GroestlCoin/bitcoin,deeponion/deeponion,GroestlCoin/bitcoin,digibyte/digibyte,viacoin/viacoin,vertcoin/vertcoin