Properly call the disconnect callback when disconnected

Fixes #14.