Added small fix for reconnect code not working reliably with TLS connect...

...ions.