OAK-826: NodeDefinition#getRequiredPrimaryTypes throws IllegalStateException

The node definitions can be at different depths of the /jcr:system/jcr:nodeTypes subtree, so we need a more flexible way to find the root of that subtree

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