Fix fast-shutdown hang on ThreadImport+GenesisWait
Fix fast-shutdown hang on ThreadImport+GenesisWait

If the user somehow manages to get into ShutdownRequested before
ThreadImport gets to ActivateBestChain() we may hang waiting on
condvar_GenesisWait forever. A simple wait_for and
ShutdownRequested resolves this case.

Bushstar/UFO-Project,OmniLayer/omnicore,MeshCollider/bitcoin,achow101/bitcoin,stamhe/bitcoin,BTCGPU/BTCGPU,domob1812/bitcoin,prusnak/bitcoin,GlobalBoost/GlobalBoost,Christewart/bitcoin,alecalve/bitcoin,fanquake/bitcoin,TheBlueMatt/bitcoin,BTCGPU/BTCGPU,jambolo/bitcoin,namecoin/namecore,prusnak/bitcoin,kazcw/bitcoin,dscotese/bitcoin,fujicoin/fujicoin,rawodb/bitcoin,mitchellcash/bitcoin,achow101/bitcoin,sipsorcery/bitcoin,alecalve/bitcoin,kallewoof/bitcoin,fanquake/bitcoin,apoelstra/bitcoin,joshrabinowitz/bitcoin,donaloconnor/bitcoin,domob1812/huntercore,Xekyo/bitcoin,fujicoin/fujicoin,domob1812/namecore,RHavar/bitcoin,Flowdalic/bitcoin,r8921039/bitcoin,MeshCollider/bitcoin,EthanHeilman/bitcoin,untrustbank/litecoin,yenliangl/bitcoin,stamhe/bitcoin,untrustbank/litecoin,cdecker/bitcoin,namecoin/namecore,digibyte/digibyte,dscotese/bitcoin,apoelstra/bitcoin,thrasher-/litecoin,rawodb/bitcoin,ryanofsky/bitcoin,randy-waterhouse/bitcoin,EthanHeilman/bitcoin,bespike/litecoin,yenliangl/bitcoin,Kogser/bitcoin,anditto/bitcoin,midnightmagic/bitcoin,Flowdalic/bitcoin,bitcoinknots/bitcoin,GlobalBoost/GlobalBoost,peercoin/peercoin,tecnovert/particl-core,bitcoinsSG/bitcoin,jtimon/bitcoin,ElementsProject/elements,qtumproject/qtum,guncoin/guncoin,EthanHeilman/bitcoin,myriadteam/myriadcoin,myriadcoin/myriadcoin,particl/particl-core,sipsorcery/bitcoin,namecoin/namecoin-core,jonasschnelli/bitcoin,ahmedbodi/vertcoin,Sjors/bitcoin,pstratem/bitcoin,afk11/bitcoin,tjps/bitcoin,sstone/bitcoin,monacoinproject/monacoin,guncoin/guncoin,randy-waterhouse/bitcoin,GroestlCoin/GroestlCoin,vertcoin/vertcoin,domob1812/huntercore,jonasschnelli/bitcoin,wellenreiter01/Feathercoin,rnicoll/bitcoin,cdecker/bitcoin,BTCGPU/BTCGPU,mruddy/bitcoin,jambolo/bitcoin,ElementsProject/elements,litecoin-project/litecoin,bespike/litecoin,namecoin/namecoin-core,sipsorcery/bitcoin,Kogser/bitcoin,kallewoof/bitcoin,GlobalBoost/GlobalBoost,Kogser/bitcoin,sstone/bitcoin,fujicoin/fujicoin,lbryio/lbrycrd,GroestlCoin/GroestlCoin,mm-s/bitcoin,tecnovert/particl-core,DigitalPandacoin/pandacoin,rawodb/bitcoin,achow101/bitcoin,alecalve/bitcoin,instagibbs/bitcoin,n1bor/bitcoin,myriadteam/myriadcoin,apoelstra/bitcoin,CryptArc/bitcoin,stamhe/bitcoin,achow101/bitcoin,namecoin/namecoin-core,Kogser/bitcoin,domob1812/bitcoin,myriadteam/myriadcoin,ahmedbodi/vertcoin,fujicoin/fujicoin,sipsorcery/bitcoin,MarcoFalke/bitcoin,droark/bitcoin,domob1812/namecore,sebrandon1/bitcoin,bespike/litecoin,TheBlueMatt/bitcoin,jamesob/bitcoin,DigitalPandacoin/pandacoin,myriadteam/myriadcoin,Xekyo/bitcoin,apoelstra/bitcoin,sebrandon1/bitcoin,stamhe/bitcoin,nikkitan/bitcoin,RHavar/bitcoin,fanquake/bitcoin,jmcorgan/bitcoin,GroestlCoin/GroestlCoin,kazcw/bitcoin,mruddy/bitcoin,myriadteam/myriadcoin,mitchellcash/bitcoin,cdecker/bitcoin,thrasher-/litecoin,joshrabinowitz/bitcoin,Kogser/bitcoin,prusnak/bitcoin,qtumproject/qtum,sstone/bitcoin,ElementsProject/elements,anditto/bitcoin,Bushstar/UFO-Project,cdecker/bitcoin,RHavar/bitcoin,Flowdalic/bitcoin,RHavar/bitcoin,lateminer/bitcoin,Xekyo/bitcoin,jtimon/bitcoin,midnightmagic/bitcoin,nikkitan/bitcoin,randy-waterhouse/bitcoin,lbryio/lbrycrd,MarcoFalke/bitcoin,pataquets/namecoin-core,mruddy/bitcoin,Sjors/bitcoin,wellenreiter01/Feathercoin,ericshawlinux/bitcoin,Kogser/bitcoin,tecnovert/particl-core,guncoin/guncoin,namecoin/namecore,ajtowns/bitcoin,alecalve/bitcoin,domob1812/huntercore,andreaskern/bitcoin,MeshCollider/bitcoin,GroestlCoin/bitcoin,anditto/bitcoin,peercoin/peercoin,thrasher-/litecoin,lateminer/bitcoin,randy-waterhouse/bitcoin,practicalswift/bitcoin,GlobalBoost/GlobalBoost,mm-s/bitcoin,Christewart/bitcoin,namecoin/namecore,afk11/bitcoin,donaloconnor/bitcoin,tjps/bitcoin,Christewart/bitcoin,domob1812/namecore,rawodb/bitcoin,peercoin/peercoin,andreaskern/bitcoin,particl/particl-core,FeatherCoin/Feathercoin,ahmedbodi/vertcoin,MarcoFalke/bitcoin,namecoin/namecore,globaltoken/globaltoken,randy-waterhouse/bitcoin,qtumproject/qtum,ahmedbodi/vertcoin,untrustbank/litecoin,jonasschnelli/bitcoin,stamhe/bitcoin,CryptArc/bitcoin,guncoin/guncoin,EthanHeilman/bitcoin,peercoin/peercoin,prusnak/bitcoin,jmcorgan/bitcoin,ahmedbodi/vertcoin,anditto/bitcoin,qtumproject/qtum,monacoinproject/monacoin,droark/bitcoin,rnicoll/dogecoin,ahmedbodi/vertcoin,guncoin/guncoin,ajtowns/bitcoin,rnicoll/dogecoin,tjps/bitcoin,stamhe/bitcoin,kazcw/bitcoin,myriadcoin/myriadcoin,afk11/bitcoin,domob1812/huntercore,JeremyRubin/bitcoin,yenliangl/bitcoin,globaltoken/globaltoken,alecalve/bitcoin,kallewoof/bitcoin,vmp32k/litecoin,yenliangl/bitcoin,jtimon/bitcoin,droark/bitcoin,qtumproject/qtum,namecoin/namecoin-core,ElementsProject/elements,mruddy/bitcoin,ericshawlinux/bitcoin,n1bor/bitcoin,GroestlCoin/bitcoin,bitcoinsSG/bitcoin,donaloconnor/bitcoin,wellenreiter01/Feathercoin,pstratem/bitcoin,jambolo/bitcoin,myriadcoin/myriadcoin,jlopp/statoshi,domob1812/bitcoin,n1bor/bitcoin,instagibbs/bitcoin,ericshawlinux/bitcoin,dscotese/bitcoin,sebrandon1/bitcoin,mitchellcash/bitcoin,jambolo/bitcoin,bitcoinsSG/bitcoin,r8921039/bitcoin,bitcoin/bitcoin,GlobalBoost/GlobalBoost,domob1812/bitcoin,nikkitan/bitcoin,apoelstra/bitcoin,nikkitan/bitcoin,instagibbs/bitcoin,FeatherCoin/Feathercoin,MarcoFalke/bitcoin,ryanofsky/bitcoin,vertcoin/vertcoin,nikkitan/bitcoin,bitcoin/bitcoin,kazcw/bitcoin,ryanofsky/bitcoin,lbryio/lbrycrd,litecoin-project/litecoin,CryptArc/bitcoin,rnicoll/bitcoin,dscotese/bitcoin,tjps/bitcoin,Xekyo/bitcoin,sipsorcery/bitcoin,paveljanik/bitcoin,paveljanik/bitcoin,dscotese/bitcoin,instagibbs/bitcoin,pataquets/namecoin-core,pataquets/namecoin-core,rawodb/bitcoin,gjhiggins/vcoincore,AkioNak/bitcoin,gjhiggins/vcoincore,domob1812/bitcoin,thrasher-/litecoin,jlopp/statoshi,joshrabinowitz/bitcoin,vmp32k/litecoin,fanquake/bitcoin,practicalswift/bitcoin,nikkitan/bitcoin,kazcw/bitcoin,mitchellcash/bitcoin,achow101/bitcoin,GlobalBoost/GlobalBoost,h4x3rotab/BTCGPU,bitcoin/bitcoin,pstratem/bitcoin,anditto/bitcoin,mm-s/bitcoin,jmcorgan/bitcoin,jtimon/bitcoin,Kogser/bitcoin,lateminer/bitcoin,AkioNak/bitcoin,fujicoin/fujicoin,GroestlCoin/bitcoin,Christewart/bitcoin,r8921039/bitcoin,TheBlueMatt/bitcoin,vertcoin/vertcoin,tjps/bitcoin,domob1812/bitcoin,bitcoinknots/bitcoin,mm-s/bitcoin,globaltoken/globaltoken,jonasschnelli/bitcoin,bespike/litecoin,EthanHeilman/bitcoin,bitcoinknots/bitcoin,lateminer/bitcoin,yenliangl/bitcoin,Flowdalic/bitcoin,guncoin/guncoin,AkioNak/bitcoin,mruddy/bitcoin,r8921039/bitcoin,donaloconnor/bitcoin,rnicoll/dogecoin,cdecker/bitcoin,Flowdalic/bitcoin,namecoin/namecoin-core,jlopp/statoshi,kallewoof/bitcoin,DigitalPandacoin/pandacoin,practicalswift/bitcoin,Bushstar/UFO-Project,JeremyRubin/bitcoin,particl/particl-core,h4x3rotab/BTCGPU,vertcoin/vertcoin,wellenreiter01/Feathercoin,AkioNak/bitcoin,h4x3rotab/BTCGPU,donaloconnor/bitcoin,jamesob/bitcoin,tecnovert/particl-core,DigitalPandacoin/pandacoin,MeshCollider/bitcoin,vmp32k/litecoin,lbryio/lbrycrd,bitcoin/bitcoin,rnicoll/bitcoin,joshrabinowitz/bitcoin,Sjors/bitcoin,gjhiggins/vcoincore,afk11/bitcoin,Xekyo/bitcoin,tecnovert/particl-core,ryanofsky/bitcoin,jtimon/bitcoin,FeatherCoin/Feathercoin,GroestlCoin/bitcoin,lbryio/lbrycrd,rnicoll/dogecoin,achow101/bitcoin,AkioNak/bitcoin,afk11/bitcoin,pataquets/namecoin-core,OmniLayer/omnicore,bespike/litecoin,bitcoinknots/bitcoin,jlopp/statoshi,n1bor/bitcoin,JeremyRubin/bitcoin,RHavar/bitcoin,randy-waterhouse/bitcoin,instagibbs/bitcoin,joshrabinowitz/bitcoin,domob1812/namecore,paveljanik/bitcoin,GroestlCoin/GroestlCoin,rawodb/bitcoin,myriadcoin/myriadcoin,TheBlueMatt/bitcoin,tjps/bitcoin,peercoin/peercoin,litecoin-project/litecoin,instagibbs/bitcoin,jmcorgan/bitcoin,bitcoinknots/bitcoin,jambolo/bitcoin,Kogser/bitcoin,andreaskern/bitcoin,fanquake/bitcoin,r8921039/bitcoin,joshrabinowitz/bitcoin,bitcoin/bitcoin,practicalswift/bitcoin,alecalve/bitcoin,CryptArc/bitcoin,anditto/bitcoin,sstone/bitcoin,pstratem/bitcoin,ericshawlinux/bitcoin,pataquets/namecoin-core,sebrandon1/bitcoin,JeremyRubin/bitcoin,gjhiggins/vcoincore,droark/bitcoin,BTCGPU/BTCGPU,GlobalBoost/GlobalBoost,globaltoken/globaltoken,monacoinproject/monacoin,jonasschnelli/bitcoin,RHavar/bitcoin,Kogser/bitcoin,ajtowns/bitcoin,thrasher-/litecoin,JeremyRubin/bitcoin,DigitalPandacoin/pandacoin,particl/particl-core,jambolo/bitcoin,domob1812/namecore,prusnak/bitcoin,untrustbank/litecoin,ElementsProject/elements,jamesob/bitcoin,OmniLayer/omnicore,mruddy/bitcoin,GroestlCoin/GroestlCoin,bitcoin/bitcoin,monacoinproject/monacoin,digibyte/digibyte,litecoin-project/litecoin,Kogser/bitcoin,vmp32k/litecoin,vertcoin/vertcoin,mitchellcash/bitcoin,afk11/bitcoin,myriadcoin/myriadcoin,Kogser/bitcoin,digibyte/digibyte,n1bor/bitcoin,jnewbery/bitcoin,mm-s/bitcoin,mitchellcash/bitcoin,h4x3rotab/BTCGPU,sebrandon1/bitcoin,lbryio/lbrycrd,Flowdalic/bitcoin,Sjors/bitcoin,jamesob/bitcoin,jnewbery/bitcoin,andreaskern/bitcoin,particl/particl-core,r8921039/bitcoin,Xekyo/bitcoin,namecoin/namecoin-core,ericshawlinux/bitcoin,jtimon/bitcoin,sipsorcery/bitcoin,h4x3rotab/BTCGPU,domob1812/namecore,MeshCollider/bitcoin,jlopp/statoshi,pstratem/bitcoin,myriadcoin/myriadcoin,wellenreiter01/Feathercoin,sebrandon1/bitcoin,ryanofsky/bitcoin,kallewoof/bitcoin,GroestlCoin/GroestlCoin,TheBlueMatt/bitcoin,andreaskern/bitcoin,practicalswift/bitcoin,ajtowns/bitcoin,monacoinproject/monacoin,bespike/litecoin,ryanofsky/bitcoin,Sjors/bitcoin,digibyte/digibyte,JeremyRubin/bitcoin,EthanHeilman/bitcoin,FeatherCoin/Feathercoin,dscotese/bitcoin,droark/bitcoin,paveljanik/bitcoin,namecoin/namecore,BTCGPU/BTCGPU,rnicoll/bitcoin,midnightmagic/bitcoin,h4x3rotab/BTCGPU,gjhiggins/vcoincore,pataquets/namecoin-core,Bushstar/UFO-Project,FeatherCoin/Feathercoin,thrasher-/litecoin,digibyte/digibyte,globaltoken/globaltoken,fanquake/bitcoin,FeatherCoin/Feathercoin,peercoin/peercoin,GroestlCoin/bitcoin,MarcoFalke/bitcoin,paveljanik/bitcoin,midnightmagic/bitcoin,Christewart/bitcoin,AkioNak/bitcoin,prusnak/bitcoin,vmp32k/litecoin,domob1812/huntercore,wellenreiter01/Feathercoin,apoelstra/bitcoin,vmp32k/litecoin,Bushstar/UFO-Project,midnightmagic/bitcoin,lateminer/bitcoin,jnewbery/bitcoin,digibyte/digibyte,CryptArc/bitcoin,jmcorgan/bitcoin,ajtowns/bitcoin,midnightmagic/bitcoin,BTCGPU/BTCGPU,ericshawlinux/bitcoin,MeshCollider/bitcoin,sstone/bitcoin,kallewoof/bitcoin,monacoinproject/monacoin,kazcw/bitcoin,paveljanik/bitcoin,TheBlueMatt/bitcoin,bitcoinsSG/bitcoin,droark/bitcoin,OmniLayer/omnicore,untrustbank/litecoin,ajtowns/bitcoin,cdecker/bitcoin,bitcoinsSG/bitcoin,jmcorgan/bitcoin,rnicoll/bitcoin,andreaskern/bitcoin,tecnovert/particl-core,Christewart/bitcoin,rnicoll/dogecoin,jamesob/bitcoin,pstratem/bitcoin,litecoin-project/litecoin,litecoin-project/litecoin,jlopp/statoshi,qtumproject/qtum,OmniLayer/omnicore,rnicoll/bitcoin,DigitalPandacoin/pandacoin,MarcoFalke/bitcoin,lateminer/bitcoin,globaltoken/globaltoken,bitcoinsSG/bitcoin,gjhiggins/vcoincore,particl/particl-core,mm-s/bitcoin,domob1812/huntercore,practicalswift/bitcoin,lbryio/lbrycrd,fujicoin/fujicoin,jnewbery/bitcoin,jnewbery/bitcoin,CryptArc/bitcoin,yenliangl/bitcoin,n1bor/bitcoin,OmniLayer/omnicore,sstone/bitcoin,ElementsProject/elements,myriadteam/myriadcoin,qtumproject/qtum,Kogser/bitcoin,Bushstar/UFO-Project,untrustbank/litecoin,jamesob/bitcoin,vertcoin/vertcoin,donaloconnor/bitcoin,GroestlCoin/bitcoin