Certain vmm ioctls, such as VM_RAISE_MSI, do not synchronize with
VM_REINIT. This can lead to use-after-frees, as VM_REINIT will free and
reallocate various bits of VM state, such as per-vCPU vlapic structures.
I think the most straightforward way to handle this is to use a per-VM
read-mostly lock to synchronize all ioctls with VM_REINIT. I had also
attempted to change VM_REINIT to avoid freeing and allocating new
structures when possible, which fixes the memory safety issues, but this
requires a fair bit of refactoring and it still seems fragile.