Fixed shutdown to completely stop and close IOLoop.