Properly call the disconnect callback when disconnected

Fixes #14.
Merge pull request #15 from demands/close_event

Properly call the disconnect callback when disconnected