Transport disconnect fixes

* Fixed crashes when <transport_disconnect> is called after a failure in connect.