Small optimization: move "getRegistry(null, null)" call out of the loop.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1593387 13f79535-47bb-0310-9956-ffa450edef68
Work around intermittent unit test failures on OSX.

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