qemu: avoid infinite loops shutting down already-shutdown VMs