try to avoid a race to death between threads

close the qemu console before we send quit and make sure no other
thread than tid==0 saves results