Implement stack-locking for multi-engine support

Implements an abstraction for distributed stack locks.  Uses a
database lock by default but has an optional Zookeeper driver that can
be used for production deployments.

Blueprint multiple-engines

Change-Id: I7fba8808d8a4efbe7fd8fdff94fd9a53f3841c8b