Add close() to broker
Properly close connection on error