Clear visitedCollections

Visited collections are cleared only in commit(). Commit clears up only if it actually has something to do. Processing large amounts of records without changing them cause visitedCollections to grow without any way of clearing.
Merge branch 'DDC-2517' into 2.3