Added checking for closed connections in websocket handler helpers
Added checking for closed connections in websocket handler helpers

Since the websocket handlers run in their own separate goroutines, it's
possible that they execute after the websocket connection has been
closed and cleaned up.  This commit add the necessary checks to ensure
stale data isn't added to notification lists and that requests to closed
connections are ignored.

This closes #92.

jongillham/btcd,Dirbaio/btcd,glv2/ppcd,jongillham/btcd,jrick/btcd,mathiasrw/btcd,ppcsuite/ppcd,sysbot/btcd,jimmysong/btcd,davecgh/btcd,dajohi/btcd,ltcsuite/ltcd,stevenroose/btcd,pkothbauer/btcd,jrick/dcrd,hectorj/btcd,FactomProject/btcd,Dirbaio/btcd,dan-da/btcd,ppcsuite/ppcd-old,btcsuite/btcd,dajohi/btcd,wallclockbuilder/btcd,CryptocurrencyCabal/htcd,Stash-Crypto/btcd,wallclockbuilder/btcd,dan-da/btcd,jimmysong/btcd,jcmincke/dcrd,Cleawing/btcd,jrick/btcd,cjepson/btcd,qchain/btcd,soapboxsys/ombfullnode,danoctavian/btcd,toddfries/btcd,dajohi/btcd,Roasbeef/btcd,adiabat/btcd,runeaune/btcd,cqswxj2013/btcd,adiabat/btcd,1d4Nf6/btcd,davecgh/btcd,ppcsuite/ppcd,sysbot/btcd,Cleawing/btcd,jcmincke/dcrd,DanielKrawisz/btcd,FactomProject/btcd,Evil-Coin/Evil,jrick/btcd,ppcsuite/ppcd-old,btcsuitereleases/btcd,hectorj/btcd,runeaune/btcd,decred/dcrd,jrick/dcrd,qchain/btcd,stevenroose/btcd,glv2/ppcd,tb00/btcd,CryptocurrencyCabal/htcd,cjepson/btcd,btcsuitereleases/btcd,toddfries/btcd,mathiasrw/btcd,Evil-Coin/Evil,decred/dcrd,ltcsuite/ltcd,BitGo/prova,Dirbaio/btcd,soapboxsys/ombfullnode,1d4Nf6/btcd,aakselrod/btcd,danoctavian/btcd,pkothbauer/btcd,tb00/btcd,BitGo/prova,cqswxj2013/btcd,DanielKrawisz/btcd,btcsuite/btcd,aakselrod/btcd,Roasbeef/btcd,jcmincke/dcrd,Stash-Crypto/btcd