Move to disconnected state after error close, clean up
Merge pull request #6 from inou/master

Move to disconnected state after error close, clean up