This is a slightly cleaner version of the patch previously posted
here:
https://listman.redhat.com/archives/libguestfs/2023-July/032167.html
Patch #8 is still irreducibly complex, but I can't see an easy way
around that.
I spent more time refining the commands that get passed to the worker
thread so that now there are only two (EASY_HANDLE and STOP), since
all operations can be expressed in terms of just those two commands.
Test & valgrind all pass, and there are no missing features.
Rich.