BS-11432, fix locking issue when deleting process instances having sub processes