Add security permission checks in Loader.static.

  - Relates to LOG4J2-633.
  - Also checks a couple related permissions.

git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk@1601027 13f79535-47bb-0310-9956-ffa450edef68
Fix NPE in OSGi.

git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk@1601029 13f79535-47bb-0310-9956-ffa450edef68
Move plugin cache file to META-INF for OSGi compatibility.

  - Using the same general location, just with META-INF/ before it.
  - Simplifies some constants.

git-svn-id: https://svn.apache.org/repos/asf/logging/log4j/log4j2/trunk@1601033 13f79535-47bb-0310-9956-ffa450edef68