OAK-1036: SegmentMK: Auto-flushing SegmentNodeBuilder

Make it possible for a subclass to set the head state of a MemoryNodeBuilder without affecting the base state

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1525682 13f79535-47bb-0310-9956-ffa450edef68
OAK-1036: SegmentMK: Auto-flushing SegmentNodeBuilder

Add auto-flushing to SegmentRootBuilder.

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