OAK-632: SegmentMK: Efficient updates of flat nodes

Fix handling of worst-case scenario where all map keys have the same hash
Move duplicate code for writing map branches to a separate method

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