JBPM-3814, BZ 1002724 Bugfixes with regards to concurrency (cherry picked from commit c29dfae77fcdaa88ed4737f41419a7099a1fa4d1)