JBPM-3814, BZ 1002724 Bugfixes with regards to locking