Prevent blocking on RPC server messages after shutdown.
Prevent blocking on RPC server messages after shutdown.

This change adds select statements to each channel write that may
occur from a non-RPCS goroutine to unblock once the server has begun
shutting down.  This prevents issues in clean shutdown where non-RPCS
goroutines may block indefinitely on message sends to the RPC server.

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