Fix an invalid pointer access in ApiClient::DisconnectSync

refs #6724