Fix crash in ApiClient::Disconnect

fixes #6672