fix closing and deregistering connection when connect fails (#128)
Merge pull request #215 from ros/issue128

fix closing and deregistering connection when connect fails (#128)