libmbim-glib,device: fix segfault when cancellable already cancelled

The g_cancellable_connect() method will also call the given callback
when the input cancellable is already cancelled. This means that the
cancellation callback should also handle the case where the transaction
hasn't been stored in the tracking table yet.

Thanks to BenoƮt Donnette <benoit.donnette@21net.com> for the report and
the suggested fix.

This is the port of the same bugfix from libqmi, see:
https://bugs.freedesktop.org/show_bug.cgi?id=98283
1 file changed