the destruction of the socket in tls_failed_read_cb() needs to be conditional; if reached due to a timeout on a timer that has subsequently been reset, the socket must not be destroyed.