Query cancellation can disconnect TCP connection

Cancelling a running query will try to disconnect TCP connection if `disconnect_on_cancel=True`.