Fix a couple of small leaks and refactor disconnect logic.

Create internal stomp_shutdown() where we can do all the free'ing in one
place.