Fix for issue #466

Changed the execution order so that the connection manager is shut down after the runnables are, this should avoid the reconnection attempt and deadlock.

I tested this on our setup that used to hang and upon client shutdown and it's working now. It'd be great if this could be released in a 2.5.1 version.