Add a DB API to swap two resources between stacks

When rolling back a stack update, we will need to swap the current and
previous (backup) resources so that the former moves to the backup stack
while the latter returns to the current stack. This API allows us to effect
the switch using a database transaction (thus avoiding having to create a
*third* stack).

Change-Id: I2b7247e384e3914778179260e198e5ae5c701525
Merge "Add a DB API to swap two resources between stacks"