Don't leak connected client for username if not connected.
Merge pull request #39 from humphd/sync-onclose-cleanup

Don't leak connected client for username if not connected.