JBPM-3869, BZ-880874 - Pessimistic locking support
(cherry picked from commit 591683751a22e43150e2a73c58ac642054771c01)
JBPM-3869, BZ-880874 - Testing pessimistic locking (cherry picked from commit d640f032486b81b0cebb201bb42114b392f86371)