Fix shutdown

there were two issues:
- we weren't closing the errors channel
- the retryHandler could exit prematurely if all brokers happened to rebalance
  at once, because its reference count would go to 0 temporarily; subsequent
  brokers starting would panic trying to send on the closed channel