Revert "channel-main: Fix dangling references to freed file-xfer-tasks on agent cancel"
Revert "channel-main: Fix dangling references to freed file-xfer-tasks on agent cancel"

The fix from commit 19313a133af0d2404b29914b5937219127ad455b is incomplete,
this commit added code to file_xfer_close_cb, to remove any reference to
the task being closed from the flushing queue.

But file_xfer_flushed / file_xfer_flush_async execute file_xfer_data_flushed_cb
from an idle handler, so it is possible that when file_xfer_close_cb runs and
frees the task, it is not part of the flushing queue, but a
file_xfer_data_flushed_cb with the task as user_data argument still needs to
run, and when it will run it will refer to the now freed task.

A related problem which is also addressed in this patchset happens when we
receive a file-xfer-cancel from the agent when an async operation on the
file_stream is pending, since we then cannot call g_input_stream_close_async
on it. This is fixed in the patchset by adding a pending flag to the task
struct, and the problem with pending flushes is solved in the same way.

Signed-off-by: Hans de Goede <9fa1be1a5b5729e4c6b404f34c9ce49ff4882fd8@redhat.com>

guodong/spice-gtk,Fantu/spice-gtk,elmarco/spice-gtk,guodong/spice-gtk,SPICE/spice-gtk,SPICE/spice-gtk,fgouget/spice-gtk,SPICE/spice-gtk,freedesktop-unofficial-mirror/spice__spice-gtk,freedesktop-unofficial-mirror/spice__spice-gtk,freedesktop-unofficial-mirror/spice__spice-gtk,guodong/spice-gtk,flexVDI/spice-gtk,elmarco/spice-gtk,SPICE/spice-gtk,elmarco/spice-gtk,fgouget/spice-gtk,guodong/spice-gtk,fgouget/spice-gtk,Fantu/spice-gtk,freedesktop-unofficial-mirror/spice__spice-gtk,Fantu/spice-gtk,Fantu/spice-gtk,elmarco/spice-gtk,flexVDI/spice-gtk