Pass the context when updating raw_templates

Without a context, the raw_template was being stored using a different DB
session, with the result that changes did not end up in the database.

Also, don't use the same raw_template DB entry for the backup stack, since
that causes competing modifications to the DB that break rollback.

Change-Id: I6c71c19acac0b87943f36c57c2300cf2b0478aa3
Closes-Bug: #1331872
Related-Bug: #1291905
Related-Bug: #1206702
Related-Bug: #1328342
Merge "Pass the context when updating raw_templates"