* Added a method called via scheduler to check and fix workflow
execution integrity. Specifically, this method finds all
task executions in RUNNING state and for each of them checks
whether all its action/workflow executions are finished. If yes,
it most likely means that the task got stuck (i.e. an RPC
was lost) and we need to repair it.
* Also added atomic update of a task execution state using the
well-known approach with "UPDATE ... WHERE" SQL query which
returns a number of actually updated rows. This prevents
from possible races between concurrent processes that try to
update a task execution in overlapping transactions.
* Other minor style changes
Change-Id: If4f2efb05d959d1ffdb16515f08a811c5ce597e6
(cherry picked from commit 0d2ebb7b01)