Fix case where block mgr could hang on shutdown.

This commit resolves an issue where it was possible the block manager
could hang on shutdown due to inventory rebroadcasting.  In particular, it
adds checks to prevent modification of the of rebroadcast inventory during
shutdown and adds a drain on the channel to ensure any outstanding
messages are discarded.

Found by @dajohi who also provided some of the code.