fix release of nil connection on connect error
Merge pull request #5 from royaltm/master

fix release of nil connection on connect error