Apply locking to control 'with-items' concurrency
Apply locking to control 'with-items' concurrency

* This commit adds a DB lock in case we need to control
  'concurrency' property for with-items. It's needed
  to make sure that we do atomic reads/writes from/to
  task runtime context that contains information about
  available capacity (number of actions allowed to run
  with the account for concurrency).

TODO:
* More testing
* Handling occuring dead locks (at least in case of MySQL)

Partial-Bug: #1640378
Change-Id: If98c3a0a66fb7b00a8099bf698ea60a4a3bf068c

openstack/mistral,StackStorm/mistral,openstack/mistral,StackStorm/mistral