Update: persist current template on change

After each resource is updated, persist the modified template to the
database so that any new resources will be accessible to API calls -
including signals to new WaitConditionHandles. This also ensures that if
the Heat engine dies completely during an update, the template in the
database will still be in a consistent state.

Change-Id: Ie6f234302cf72213d4b0e1f5b963cd8def422498
Closes-Bug: #1291905
Closes-Bug: #1206702
Closes-Bug: #1328342
Implements: partial-blueprint update-failure-recovery
Merge "Update: persist current template on change"