Allow raw templates to be updated in the DB

Note that although this raw_template_update_template() will get called at
least every time the stack changes state (so twice for each operation), the
performance cost is negligible: we use the context's session, so the get()
will just retrieve the session's cached object, and we don't issue the
write unless the template has actually changed.

Change-Id: I3f231b88d08ab31c275cb9fecbf2600456c793c3
Merge "Allow raw templates to be updated in the DB"