kvmtool: assume dead vcpus are paused too

vcpus that have exited their main loop can be treated as paused too when we're
trying to pause the machine to change mappings.

This might happen during shutdown when we're trying to unmap ioports but some
of the vcpus already exited.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
diff --git a/kvm.c b/kvm.c
index 10ed230..07d4cc3 100644
--- a/kvm.c
+++ b/kvm.c
@@ -442,7 +442,10 @@
 	if (pause_event < 0)
 		die("Failed creating pause notification event");
 	for (i = 0; i < kvm->nrcpus; i++)
-		pthread_kill(kvm->cpus[i]->thread, SIGKVMPAUSE);
+		if (kvm->cpus[i]->is_running)
+			pthread_kill(kvm->cpus[i]->thread, SIGKVMPAUSE);
+		else
+			paused_vcpus++;
 
 	while (paused_vcpus < kvm->nrcpus) {
 		u64 cur_read;