Fixed shutdown issues as reported by Alex. When an exception was thrown,
the netty threads were not stopped.