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
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