made the deferred stuff in both the goroutines not panic if they try to close things that are already closed - this was much simpler than keeping state in sync to not double close... after all, the socket can break in many ways, and the channels can be closed externally etc.
Merge pull request #2 from zond/master

Removed some panic situations that shouldn't result in panics..