Prevent metadata updates until instance is active.

This avoids a race condition where setting metadata too early in the
build process can cause a build failure due to the VM not existing
in Xen.

bug 1100866

Change-Id: I702128799997d91d5f0c0ac189f619bfdf011988
Merge "Prevent metadata updates until instance is active."
Merge remote-tracking branch 'citrix/master' into build-temp