Implement stack-locking for multi-engine support

Implements a distributed stack lock using the database to avoid race
conditions when multiple engines are deployed.

Blueprint multiple-engines

Change-Id: I7fba8808d8a4efbe7fd8fdff94fd9a53f3841c8b
Database changes for multi-engine support

Add a stack_lock database table to use as a distributed stack lock to
avoid race conditions when multiple engines are deployed.

Blueprint multiple-engines

Change-Id: I0b8e244a73295dca307cb09ea5da2ebe709134b1
Utilize stack-lock for multi-engine support

Utilize a distributed stack lock to avoid race conditions when multiple
engines are deployed.

Blueprint multiple-engines

Change-Id: I2278c7922557b6234cd7ff162cea92af83e9fb8b