removal of listeners before closing results in disconnect state not being set
Merge pull request #67 from garyhodgson/master

removal of listeners before closing results in disconnect state not being set