SLING-3660 : refine repository connect/disconnect states together with allowing getNodeTypeRegistry to return null (when never loaded) - and caching of the nodeTypeRegistry properly

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