fixed JPAPlaceholderResolverStrategy to be able to process entities during beforeCompletion phase when process variables and facts are transformed

(cherry picked from commit b2b46036f45932214f9cbc11b74987fa1b759638)
avoid concurrent modification exceptions in edge cases by using iterator

(cherry picked from commit baa9839b9b3cd53a014d54c55095c06dba8bd3dd)