c: Destroy callback thread in all error paths of the connect function

Except for auto-reconnects.
python: Destroy callback thread in all error paths of the connect function

Except for auto-reconnects.