BUG: spatial/qhull: fix a deadlock condition
BUG: spatial/qhull: fix a deadlock condition

Python garbage collector can run a __del__ method in principle at any
time.  If this happens inside a _Qhull method that holds the qhull lock,
and the destructor calls _Qhull.close, a deadlock ensues.

This commit makes _Qhull.close safe to run in a destructor, by
postponing the cleanup if the lock is held.

This issue affects only code using the incremental=True mode, as in
other cases the cleanup is performed immediately after use and not from
the destructor.

Also, remove the __del__ method from _Qhull so that the close() method
is never called from the class's own destructor.

tylerjereddy/scipy,Gillu13/scipy,mhogg/scipy,niknow/scipy,ChanderG/scipy,jjhelmus/scipy,e-q/scipy,Srisai85/scipy,Gillu13/scipy,gertingold/scipy,mortada/scipy,vanpact/scipy,trankmichael/scipy,Shaswat27/scipy,kalvdans/scipy,fredrikw/scipy,mtrbean/scipy,jakevdp/scipy,mingwpy/scipy,jakevdp/scipy,ogrisel/scipy,raoulbq/scipy,larsmans/scipy,giorgiop/scipy,futurulus/scipy,gertingold/scipy,scipy/scipy,josephcslater/scipy,fernand/scipy,aman-iitj/scipy,andim/scipy,anielsen001/scipy,zerothi/scipy,argriffing/scipy,Newman101/scipy,FRidh/scipy,woodscn/scipy,minhlongdo/scipy,bkendzior/scipy,befelix/scipy,Kamp9/scipy,trankmichael/scipy,vigna/scipy,fredrikw/scipy,apbard/scipy,felipebetancur/scipy,juliantaylor/scipy,kleskjr/scipy,njwilson23/scipy,maciejkula/scipy,maciejkula/scipy,maciejkula/scipy,lhilt/scipy,woodscn/scipy,jsilter/scipy,mortada/scipy,pnedunuri/scipy,zxsted/scipy,arokem/scipy,ChanderG/scipy,mgaitan/scipy,lukauskas/scipy,FRidh/scipy,aarchiba/scipy,aeklant/scipy,Newman101/scipy,zaxliu/scipy,anntzer/scipy,chatcannon/scipy,bkendzior/scipy,mtrbean/scipy,maniteja123/scipy,lukauskas/scipy,lukauskas/scipy,mikebenfield/scipy,e-q/scipy,rmcgibbo/scipy,pyramania/scipy,ilayn/scipy,bkendzior/scipy,jjhelmus/scipy,mikebenfield/scipy,zerothi/scipy,surhudm/scipy,rgommers/scipy,Dapid/scipy,mingwpy/scipy,vanpact/scipy,matthew-brett/scipy,aeklant/scipy,endolith/scipy,zaxliu/scipy,e-q/scipy,grlee77/scipy,dominicelse/scipy,person142/scipy,newemailjdm/scipy,petebachant/scipy,josephcslater/scipy,pschella/scipy,Dapid/scipy,giorgiop/scipy,aarchiba/scipy,endolith/scipy,aeklant/scipy,pbrod/scipy,ogrisel/scipy,Newman101/scipy,Shaswat27/scipy,anntzer/scipy,raoulbq/scipy,jor-/scipy,fredrikw/scipy,aeklant/scipy,mhogg/scipy,jor-/scipy,trankmichael/scipy,richardotis/scipy,ilayn/scipy,kleskjr/scipy,minhlongdo/scipy,argriffing/scipy,person142/scipy,mdhaber/scipy,mortonjt/scipy,perimosocordiae/scipy,mortonjt/scipy,argriffing/scipy,newemailjdm/scipy,zxsted/scipy,WarrenWeckesser/scipy,giorgiop/scipy,richardotis/scipy,scipy/scipy,hainm/scipy,WillieMaddox/scipy,ChanderG/scipy,nvoron23/scipy,anntzer/scipy,juliantaylor/scipy,zaxliu/scipy,jjhelmus/scipy,raoulbq/scipy,arokem/scipy,jseabold/scipy,woodscn/scipy,sauliusl/scipy,mdhaber/scipy,apbard/scipy,nvoron23/scipy,Gillu13/scipy,zerothi/scipy,aman-iitj/scipy,fernand/scipy,mingwpy/scipy,chatcannon/scipy,gfyoung/scipy,ogrisel/scipy,nonhermitian/scipy,lhilt/scipy,nvoron23/scipy,nvoron23/scipy,larsmans/scipy,ortylp/scipy,sauliusl/scipy,arokem/scipy,pyramania/scipy,surhudm/scipy,anielsen001/scipy,niknow/scipy,zerothi/scipy,newemailjdm/scipy,andim/scipy,matthew-brett/scipy,dominicelse/scipy,behzadnouri/scipy,lukauskas/scipy,richardotis/scipy,jonycgn/scipy,Kamp9/scipy,pizzathief/scipy,andyfaff/scipy,ales-erjavec/scipy,kleskjr/scipy,ortylp/scipy,mdhaber/scipy,hainm/scipy,zerothi/scipy,Newman101/scipy,aman-iitj/scipy,befelix/scipy,vigna/scipy,mtrbean/scipy,petebachant/scipy,haudren/scipy,jakevdp/scipy,rmcgibbo/scipy,pbrod/scipy,newemailjdm/scipy,zxsted/scipy,gfyoung/scipy,Gillu13/scipy,andim/scipy,sriki18/scipy,ortylp/scipy,futurulus/scipy,cpaulik/scipy,apbard/scipy,gfyoung/scipy,ales-erjavec/scipy,gef756/scipy,WillieMaddox/scipy,matthew-brett/scipy,jonycgn/scipy,mtrbean/scipy,lhilt/scipy,gfyoung/scipy,woodscn/scipy,mtrbean/scipy,behzadnouri/scipy,Newman101/scipy,ndchorley/scipy,witcxc/scipy,bkendzior/scipy,mingwpy/scipy,WarrenWeckesser/scipy,vhaasteren/scipy,jor-/scipy,sonnyhu/scipy,piyush0609/scipy,njwilson23/scipy,pschella/scipy,richardotis/scipy,minhlongdo/scipy,dch312/scipy,andyfaff/scipy,argriffing/scipy,dominicelse/scipy,rmcgibbo/scipy,nmayorov/scipy,vberaudi/scipy,matthewalbani/scipy,mikebenfield/scipy,gdooper/scipy,jsilter/scipy,pyramania/scipy,gef756/scipy,ndchorley/scipy,pizzathief/scipy,juliantaylor/scipy,juliantaylor/scipy,giorgiop/scipy,minhlongdo/scipy,chatcannon/scipy,nvoron23/scipy,sriki18/scipy,sonnyhu/scipy,Dapid/scipy,fernand/scipy,petebachant/scipy,Newman101/scipy,giorgiop/scipy,nmayorov/scipy,pizzathief/scipy,efiring/scipy,fernand/scipy,jonycgn/scipy,anntzer/scipy,anielsen001/scipy,pnedunuri/scipy,FRidh/scipy,jakevdp/scipy,Eric89GXL/scipy,ChanderG/scipy,newemailjdm/scipy,ilayn/scipy,haudren/scipy,minhlongdo/scipy,cpaulik/scipy,nonhermitian/scipy,raoulbq/scipy,raoulbq/scipy,vhaasteren/scipy,niknow/scipy,mikebenfield/scipy,pbrod/scipy,niknow/scipy,anntzer/scipy,cpaulik/scipy,tylerjereddy/scipy,maciejkula/scipy,aarchiba/scipy,josephcslater/scipy,mingwpy/scipy,mortonjt/scipy,Stefan-Endres/scipy,Dapid/scipy,aman-iitj/scipy,sriki18/scipy,gdooper/scipy,matthew-brett/scipy,pnedunuri/scipy,witcxc/scipy,pschella/scipy,jor-/scipy,vberaudi/scipy,fredrikw/scipy,fernand/scipy,endolith/scipy,nvoron23/scipy,raoulbq/scipy,perimosocordiae/scipy,aman-iitj/scipy,dch312/scipy,efiring/scipy,felipebetancur/scipy,tylerjereddy/scipy,haudren/scipy,arokem/scipy,pnedunuri/scipy,WarrenWeckesser/scipy,mingwpy/scipy,efiring/scipy,larsmans/scipy,ndchorley/scipy,person142/scipy,cpaulik/scipy,endolith/scipy,gef756/scipy,person142/scipy,Gillu13/scipy,mortonjt/scipy,lukauskas/scipy,maniteja123/scipy,minhlongdo/scipy,pizzathief/scipy,mgaitan/scipy,fredrikw/scipy,efiring/scipy,argriffing/scipy,vhaasteren/scipy,njwilson23/scipy,jsilter/scipy,njwilson23/scipy,WillieMaddox/scipy,fernand/scipy,aman-iitj/scipy,kalvdans/scipy,kalvdans/scipy,jsilter/scipy,ales-erjavec/scipy,vberaudi/scipy,bkendzior/scipy,scipy/scipy,maniteja123/scipy,befelix/scipy,pschella/scipy,jor-/scipy,WarrenWeckesser/scipy,piyush0609/scipy,rgommers/scipy,rmcgibbo/scipy,zerothi/scipy,josephcslater/scipy,jsilter/scipy,surhudm/scipy,arokem/scipy,Dapid/scipy,jamestwebber/scipy,larsmans/scipy,Srisai85/scipy,jseabold/scipy,aeklant/scipy,ilayn/scipy,mhogg/scipy,pschella/scipy,zxsted/scipy,richardotis/scipy,ortylp/scipy,vigna/scipy,matthew-brett/scipy,cpaulik/scipy,hainm/scipy,apbard/scipy,ortylp/scipy,behzadnouri/scipy,tylerjereddy/scipy,larsmans/scipy,Eric89GXL/scipy,aarchiba/scipy,Kamp9/scipy,kleskjr/scipy,cpaulik/scipy,Eric89GXL/scipy,nonhermitian/scipy,jamestwebber/scipy,grlee77/scipy,efiring/scipy,surhudm/scipy,gef756/scipy,pnedunuri/scipy,kleskjr/scipy,piyush0609/scipy,mgaitan/scipy,behzadnouri/scipy,grlee77/scipy,Shaswat27/scipy,mortada/scipy,giorgiop/scipy,FRidh/scipy,jonycgn/scipy,piyush0609/scipy,vanpact/scipy,gertingold/scipy,andim/scipy,mortada/scipy,ndchorley/scipy,matthewalbani/scipy,chatcannon/scipy,rgommers/scipy,Eric89GXL/scipy,futurulus/scipy,zaxliu/scipy,mtrbean/scipy,maniteja123/scipy,vberaudi/scipy,surhudm/scipy,Stefan-Endres/scipy,mdhaber/scipy,mortonjt/scipy,mdhaber/scipy,futurulus/scipy,mdhaber/scipy,niknow/scipy,chatcannon/scipy,vanpact/scipy,matthewalbani/scipy,Shaswat27/scipy,Shaswat27/scipy,witcxc/scipy,maniteja123/scipy,pnedunuri/scipy,Srisai85/scipy,mhogg/scipy,lukauskas/scipy,mortonjt/scipy,zxsted/scipy,sriki18/scipy,vigna/scipy,jonycgn/scipy,vhaasteren/scipy,petebachant/scipy,jseabold/scipy,Stefan-Endres/scipy,ilayn/scipy,jamestwebber/scipy,rgommers/scipy,befelix/scipy,fredrikw/scipy,tylerjereddy/scipy,sonnyhu/scipy,felipebetancur/scipy,mortada/scipy,pyramania/scipy,felipebetancur/scipy,pyramania/scipy,trankmichael/scipy,vberaudi/scipy,ales-erjavec/scipy,efiring/scipy,lhilt/scipy,andim/scipy,trankmichael/scipy,grlee77/scipy,grlee77/scipy,e-q/scipy,scipy/scipy,gef756/scipy,njwilson23/scipy,zxsted/scipy,sriki18/scipy,Eric89GXL/scipy,Dapid/scipy,gfyoung/scipy,nonhermitian/scipy,ortylp/scipy,e-q/scipy,perimosocordiae/scipy,vanpact/scipy,dch312/scipy,FRidh/scipy,andyfaff/scipy,nmayorov/scipy,WarrenWeckesser/scipy,Stefan-Endres/scipy,Eric89GXL/scipy,ChanderG/scipy,WillieMaddox/scipy,vberaudi/scipy,surhudm/scipy,vigna/scipy,zaxliu/scipy,josephcslater/scipy,endolith/scipy,futurulus/scipy,pizzathief/scipy,petebachant/scipy,larsmans/scipy,gdooper/scipy,andyfaff/scipy,gertingold/scipy,sonnyhu/scipy,petebachant/scipy,mortada/scipy,sriki18/scipy,niknow/scipy,sauliusl/scipy,mhogg/scipy,kalvdans/scipy,Kamp9/scipy,ilayn/scipy,Srisai85/scipy,Shaswat27/scipy,anielsen001/scipy,nmayorov/scipy,witcxc/scipy,pbrod/scipy,piyush0609/scipy,FRidh/scipy,sonnyhu/scipy,Srisai85/scipy,aarchiba/scipy,woodscn/scipy,WarrenWeckesser/scipy,haudren/scipy,woodscn/scipy,argriffing/scipy,jjhelmus/scipy,gdooper/scipy,gef756/scipy,zaxliu/scipy,Stefan-Endres/scipy,person142/scipy,matthewalbani/scipy,sauliusl/scipy,jjhelmus/scipy,jonycgn/scipy,rmcgibbo/scipy,kalvdans/scipy,richardotis/scipy,WillieMaddox/scipy,dch312/scipy,ales-erjavec/scipy,perimosocordiae/scipy,vhaasteren/scipy,dch312/scipy,gertingold/scipy,Stefan-Endres/scipy,jseabold/scipy,ogrisel/scipy,kleskjr/scipy,nonhermitian/scipy,apbard/scipy,scipy/scipy,sonnyhu/scipy,mgaitan/scipy,ogrisel/scipy,pbrod/scipy,vanpact/scipy,dominicelse/scipy,hainm/scipy,jseabold/scipy,gdooper/scipy,hainm/scipy,nmayorov/scipy,maniteja123/scipy,andyfaff/scipy,jamestwebber/scipy,rgommers/scipy,witcxc/scipy,maciejkula/scipy,ales-erjavec/scipy,chatcannon/scipy,felipebetancur/scipy,mgaitan/scipy,anielsen001/scipy,mgaitan/scipy,scipy/scipy,ndchorley/scipy,sauliusl/scipy,behzadnouri/scipy,ChanderG/scipy,newemailjdm/scipy,haudren/scipy,befelix/scipy,hainm/scipy,andim/scipy,lhilt/scipy,Kamp9/scipy,perimosocordiae/scipy,endolith/scipy,Gillu13/scipy,matthewalbani/scipy,pbrod/scipy,Srisai85/scipy,anntzer/scipy,rmcgibbo/scipy,mikebenfield/scipy,jamestwebber/scipy,jseabold/scipy,piyush0609/scipy,perimosocordiae/scipy,juliantaylor/scipy,futurulus/scipy,jakevdp/scipy,behzadnouri/scipy,WillieMaddox/scipy,mhogg/scipy,haudren/scipy,dominicelse/scipy,vhaasteren/scipy,felipebetancur/scipy,Kamp9/scipy,sauliusl/scipy,anielsen001/scipy,andyfaff/scipy,njwilson23/scipy,ndchorley/scipy,trankmichael/scipy