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