Fix a crash in STM when unregisterised
Fix a crash in STM when unregisterised

Fixes several test failures:
   ../../libraries/stm/tests       2411 [bad exit code] (normal,hpc,profasm,ghci,optllvm)
   ../../libraries/stm/tests       stm046 [bad exit code] (normal,hpc,profasm,ghci,optllvm)
   ../../libraries/stm/tests       stm061 [bad exit code] (normal,hpc,profasm,ghci,optllvm)

anton-dessiatov/ghc,hferreiro/replay,christiaanb/ghc,sdiehl/ghc,AlexanderPankiv/ghc,AlexanderPankiv/ghc,gridaphobe/ghc,holzensp/ghc,gridaphobe/ghc,mfine/ghc,wxwxwwxxx/ghc,ml9951/ghc,gcampax/ghc,anton-dessiatov/ghc,nathyong/microghc-ghc,snoyberg/ghc,ezyang/ghc,nkaretnikov/ghc,nomeata/ghc,wxwxwwxxx/ghc,nathyong/microghc-ghc,ezyang/ghc,nkaretnikov/ghc,elieux/ghc,snoyberg/ghc,sdiehl/ghc,christiaanb/ghc,holzensp/ghc,ryantm/ghc,jstolarek/ghc,GaloisInc/halvm-ghc,vTurbine/ghc,vikraman/ghc,snoyberg/ghc,spacekitteh/smcghc,sgillespie/ghc,ml9951/ghc,gcampax/ghc,frantisekfarka/ghc-dsi,ml9951/ghc,shlevy/ghc,acowley/ghc,olsner/ghc,elieux/ghc,da-x/ghc,vTurbine/ghc,AlexanderPankiv/ghc,ekmett/ghc,GaloisInc/halvm-ghc,mettekou/ghc,da-x/ghc,mcschroeder/ghc,green-haskell/ghc,mcschroeder/ghc,TomMD/ghc,nathyong/microghc-ghc,acowley/ghc,lukexi/ghc,vTurbine/ghc,nomeata/ghc,forked-upstream-packages-for-ghcjs/ghc,mcschroeder/ghc,gcampax/ghc,fmthoma/ghc,frantisekfarka/ghc-dsi,ekmett/ghc,acowley/ghc,ryantm/ghc,oldmanmike/ghc,hferreiro/replay,sdiehl/ghc,urbanslug/ghc,vikraman/ghc,tjakway/ghcjvm,anton-dessiatov/ghc,green-haskell/ghc,lukexi/ghc-7.8-arm64,lukexi/ghc,mcschroeder/ghc,ghc-android/ghc,gcampax/ghc,fmthoma/ghc,bitemyapp/ghc,lukexi/ghc,bitemyapp/ghc,anton-dessiatov/ghc,frantisekfarka/ghc-dsi,siddhanathan/ghc,nkaretnikov/ghc,lukexi/ghc,christiaanb/ghc,forked-upstream-packages-for-ghcjs/ghc,sgillespie/ghc,shlevy/ghc,lukexi/ghc-7.8-arm64,siddhanathan/ghc,mettekou/ghc,mfine/ghc,da-x/ghc,nushio3/ghc,green-haskell/ghc,urbanslug/ghc,nathyong/microghc-ghc,vikraman/ghc,nkaretnikov/ghc,ekmett/ghc,siddhanathan/ghc,AlexanderPankiv/ghc,mcschroeder/ghc,nushio3/ghc,vTurbine/ghc,snoyberg/ghc,vikraman/ghc,vTurbine/ghc,urbanslug/ghc,mfine/ghc,TomMD/ghc,jstolarek/ghc,sdiehl/ghc,mettekou/ghc,TomMD/ghc,christiaanb/ghc,wxwxwwxxx/ghc,nushio3/ghc,olsner/ghc,elieux/ghc,gcampax/ghc,lukexi/ghc-7.8-arm64,tjakway/ghcjvm,snoyberg/ghc,nushio3/ghc,olsner/ghc,frantisekfarka/ghc-dsi,TomMD/ghc,nkaretnikov/ghc,spacekitteh/smcghc,ezyang/ghc,hferreiro/replay,elieux/ghc,da-x/ghc,tibbe/ghc,frantisekfarka/ghc-dsi,GaloisInc/halvm-ghc,ml9951/ghc,ryantm/ghc,oldmanmike/ghc,nathyong/microghc-ghc,lukexi/ghc-7.8-arm64,ekmett/ghc,ml9951/ghc,acowley/ghc,mettekou/ghc,mettekou/ghc,jstolarek/ghc,fmthoma/ghc,spacekitteh/smcghc,olsner/ghc,holzensp/ghc,fmthoma/ghc,shlevy/ghc,ezyang/ghc,ghc-android/ghc,olsner/ghc,fmthoma/ghc,ryantm/ghc,lukexi/ghc-7.8-arm64,acowley/ghc,nathyong/microghc-ghc,tjakway/ghcjvm,oldmanmike/ghc,urbanslug/ghc,hferreiro/replay,oldmanmike/ghc,acowley/ghc,ml9951/ghc,shlevy/ghc,anton-dessiatov/ghc,olsner/ghc,nkaretnikov/ghc,shlevy/ghc,sgillespie/ghc,tjakway/ghcjvm,vTurbine/ghc,forked-upstream-packages-for-ghcjs/ghc,ghc-android/ghc,AlexanderPankiv/ghc,sgillespie/ghc,tjakway/ghcjvm,tibbe/ghc,mcschroeder/ghc,gridaphobe/ghc,anton-dessiatov/ghc,nomeata/ghc,TomMD/ghc,nkaretnikov/ghc,ghc-android/ghc,green-haskell/ghc,hferreiro/replay,sdiehl/ghc,ekmett/ghc,elieux/ghc,christiaanb/ghc,urbanslug/ghc,sgillespie/ghc,bitemyapp/ghc,wxwxwwxxx/ghc,jstolarek/ghc,mcschroeder/ghc,tibbe/ghc,nomeata/ghc,sgillespie/ghc,sdiehl/ghc,gridaphobe/ghc,da-x/ghc,GaloisInc/halvm-ghc,GaloisInc/halvm-ghc,GaloisInc/halvm-ghc,fmthoma/ghc,ghc-android/ghc,gridaphobe/ghc,AlexanderPankiv/ghc,AlexanderPankiv/ghc,da-x/ghc,shlevy/ghc,bitemyapp/ghc,urbanslug/ghc,hferreiro/replay,urbanslug/ghc,shlevy/ghc,nathyong/microghc-ghc,ghc-android/ghc,fmthoma/ghc,holzensp/ghc,ezyang/ghc,gridaphobe/ghc,wxwxwwxxx/ghc,TomMD/ghc,siddhanathan/ghc,vikraman/ghc,TomMD/ghc,nushio3/ghc,vTurbine/ghc,wxwxwwxxx/ghc,siddhanathan/ghc,forked-upstream-packages-for-ghcjs/ghc,sgillespie/ghc,siddhanathan/ghc,mettekou/ghc,tjakway/ghcjvm,bitemyapp/ghc,nushio3/ghc,ryantm/ghc,ml9951/ghc,tjakway/ghcjvm,christiaanb/ghc,gridaphobe/ghc,vikraman/ghc,christiaanb/ghc,holzensp/ghc,green-haskell/ghc,lukexi/ghc,snoyberg/ghc,forked-upstream-packages-for-ghcjs/ghc,elieux/ghc,ezyang/ghc,jstolarek/ghc,mfine/ghc,gcampax/ghc,olsner/ghc,anton-dessiatov/ghc,gcampax/ghc,forked-upstream-packages-for-ghcjs/ghc,nushio3/ghc,mettekou/ghc,ezyang/ghc,acowley/ghc,oldmanmike/ghc,forked-upstream-packages-for-ghcjs/ghc,ghc-android/ghc,tibbe/ghc,GaloisInc/halvm-ghc,snoyberg/ghc,tibbe/ghc,mfine/ghc,vikraman/ghc,oldmanmike/ghc,nomeata/ghc,mfine/ghc,sdiehl/ghc,wxwxwwxxx/ghc,mfine/ghc,elieux/ghc,oldmanmike/ghc,ml9951/ghc,spacekitteh/smcghc,spacekitteh/smcghc,da-x/ghc,siddhanathan/ghc,hferreiro/replay