Added checks to clear input/reset record buffer when TLS connection closes/errors.
Added checks to clear input/reset record buffer when TLS connection
closes/errors.

digitalbazaar/bitmunk,digitalbazaar/bitmunk,digitalbazaar/bitmunk,digitalbazaar/bitmunk