Race condition between VM shutdown and cleaning VMX for vmware builder.

I recently have been having an issue utilizing the vmware-iso builder and vsphere post-processor with my boxes getting shipped to vSphere with the ISO still attached to the cd-rom approximately 90% of the time.

I tracked the issue down to a race condition between VMware shutdown and Packer cleaning up the VMX file, where Packer performs the cleanup and saving for the VMX before VMware writes the final version of the VMX file.  This results in VMware overwriting any changes performed by Packer to the VMX file, and the cd-rom ISO still being present inside the resulting VMX.

Packer does currently have logic in place to help determine when VMware has completed its shutdown, however, it does not handle this particular case, as VMWare does not seem to generate a '.vmx.lck' file which is what Packer is flagging off of.

Vagrant: 0.5.1
VMware Fusion Pro 6.0.2 (1398658)
OSX Mavericks