just close the connection if the connection is already connected
Merge pull request #28 from swznd/develop

Only close the connection if it's open.