telepathy: fix crashes in error/shutdown cases
Add a GCancellable to all async operations. When disconnecting the
transport we set the cancel flag and invalidate the error callback.
Check that error callback is valid in all async callbacks.
The same also applies to the DNS queries callback.
Storing the server transport pointer to the private backend data
structure is now done after the socket is connected. Before that we
shouldn't send any messages on shutdown.
Freeing the transport data structure also needs to be done
asynchronously, because only when we return to the main event loop the
cancellations & closing will be handled by GIO.
With these changes in place I have not been able to crash the CM anymore
with wild & random account enable & disable attempts.