fdstream: Report error from the I/O thread
fdstream: Report error from the I/O thread

https://bugzilla.redhat.com/show_bug.cgi?id=1529059

Commit id 0fe4aa14 added the thread specific error message
reporting (or save) to virFDStreamEvent; however, as processing
goes via virStream{Send|SendHole|Recv} via calls from
daemonStreamHandle{WriteData|Hole|Read} the last error
gets reset in the main libvirt API's thus, whatever error
may have been set as last error will be cleared prior to
the error paths using it resulting in the generic error
on the client side.

For each of the paths that check threadQuit or threadErr,
check if threadErr was set and set it agian if there isn't
a last error (e.g. some other failure) set so that the
message can be provided back to the client.

Signed-off-by: John Ferlan <87558058f6f829e5ec976c8ef960720af4ff9c7d@redhat.com>
ACKed-by: Michal Privoznik <83d82aaba2eed257f4814b0c239c260c4caaadf0@redhat.com>

jardasgit/libvirt,nertpinx/libvirt,zippy2/libvirt,libvirt/libvirt,andreabolognani/libvirt,jfehlig/libvirt,olafhering/libvirt,libvirt/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,jardasgit/libvirt,nertpinx/libvirt,libvirt/libvirt,olafhering/libvirt,eskultety/libvirt,fabianfreyer/libvirt,eskultety/libvirt,nertpinx/libvirt,eskultety/libvirt,fabianfreyer/libvirt,nertpinx/libvirt,nertpinx/libvirt,eskultety/libvirt,jardasgit/libvirt,fabianfreyer/libvirt,crobinso/libvirt,libvirt/libvirt,jfehlig/libvirt,crobinso/libvirt,eskultety/libvirt,olafhering/libvirt,fabianfreyer/libvirt,olafhering/libvirt,andreabolognani/libvirt,crobinso/libvirt,jardasgit/libvirt,crobinso/libvirt,zippy2/libvirt,jfehlig/libvirt,zippy2/libvirt,jardasgit/libvirt,andreabolognani/libvirt,zippy2/libvirt,andreabolognani/libvirt,jfehlig/libvirt