Custom handling disconnect

Fixes #35 by unregistering callbacks before disconnecting. There are quite a few races caused by that.

I also removed the unused pread channel, and moved errors into an exposable error channel as a method.