OAK-778: Recursive wrapping of ModifiedNodeState

Add a collapse() call to ModifiedNodeState.with() to avoid too many levels of wrapping.
TODO: A better solution will be to identify and fix the root causes of such re-wrapping.

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1468828 13f79535-47bb-0310-9956-ffa450edef68