Fix VBOX_E_INVALID_OBJECT_STATE error

My Vagrant/Homestead box started consuming tons of CPU, so I ran vagrant halt. This hung for 5-10 minutes without progress, so I Ctrl+C’d it and tried again. Quickly exited without any sort of error message.

At this point I tried vagrant up but it complained “Stderr: VBoxManage: error: The machine ‘homestead-7’ is already locked for a session (or being unlocked)”.

After a bit of Googling, found this. Running VBoxManage startvm homestead-7 --type emergencystop got it to shut down properly and vagrant up worked after that.