Fix hang during shutdown when client is connected.
Fix hang during shutdown when client is connected.

Closes #108.

synrg-labs/btcwallet,Roasbeef/btcwallet,Stash-Crypto/btcwallet,decred/dcrwallet,jrick/btcwallet,jrick/btcwallet,synrg-labs/btcwallet,btcsuite/btcwallet,decred/dcrwallet,Stash-Crypto/btcwallet,jrick/dcrwallet,jrick/dcrwallet,btcsuite/btcwallet,Roasbeef/btcwallet