Handle metadata updates during stack creation

Don't try to recalculate the metadata on an instance that hasn't yet been
stored in the database.

Fixes bug #1185530

Change-Id: I39f2733e2ba4730ea05a4a50962cb30f044ef752
Merge "Handle metadata updates during stack creation"