title: Jackrabbit unclosed session detected on AccessDeniedException but session is null
body: <p>I'm working with Jackrabbit 2.13.1.</p>
  
  <p>Why AccessDeniedException causes session leak?</p>
  
  <pre><code>        try {
              session = repository.login(creds); //here are creds for user without permissions, just for testing
          } catch (Throwable t) {
              if (session != null) {
                  session.logout();
              }
              Throwables.propagateIfInstanceOf(t, javax.jcr.RepositoryException.class);
              throw Throwables.propagate(t);
          }
  </code></pre>
  
  <p>This throws, as expected, AccessDeniedException:</p>
  
  <pre><code>Caused by: javax.jcr.LoginException: Workspace access denied
      at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1529)
      at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:144)
      at ttt.createSession(RepositoryManager.java:132)
      ... 51 common frames omitted
  
  Caused by: javax.jcr.AccessDeniedException: Not allowed to access Workspace default
      at org.apache.jackrabbit.core.security.DefaultAccessManager.init(DefaultAccessManager.java:159)
      at org.apache.jackrabbit.core.DefaultSecurityManager.getAccessManager(DefaultSecurityManager.java:280)
      at org.apache.jackrabbit.core.SessionImpl.createAccessManager(SessionImpl.java:356)
      at org.apache.jackrabbit.core.SessionImpl.&lt;init&gt;(SessionImpl.java:273)
      at org.apache.jackrabbit.core.SessionImpl.&lt;init&gt;(SessionImpl.java:239)
      at org.apache.jackrabbit.core.XASessionImpl.&lt;init&gt;(XASessionImpl.java:101)
      at org.apache.jackrabbit.core.RepositoryImpl.createSessionInstance(RepositoryImpl.java:1613)
      at org.apache.jackrabbit.core.RepositoryImpl.createSession(RepositoryImpl.java:956)
      at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1501)
  </code></pre>
  
  <p>session is null, so I'm unable to call logout on it. But unclosed session detected exception is thrown:</p>
  
  <pre><code>WARN  o.a.jackrabbit.core.SessionImpl - Unclosed session detected. The session was opened here: 
  java.lang.Exception: Stack Trace
      at org.apache.jackrabbit.core.SessionImpl.&lt;init&gt;(SessionImpl.java:222)
      at org.apache.jackrabbit.core.SessionImpl.&lt;init&gt;(SessionImpl.java:239)
      at org.apache.jackrabbit.core.XASessionImpl.&lt;init&gt;(XASessionImpl.java:101)
      at org.apache.jackrabbit.core.RepositoryImpl.createSessionInstance(RepositoryImpl.java:1613)
      at org.apache.jackrabbit.core.RepositoryImpl.createSession(RepositoryImpl.java:956)
      at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1501)
      at org.apache.jackrabbit.commons.AbstractRepository.login(AbstractRepository.java:144)
      at ttt.createSession(RepositoryManager.java:132)
  </code></pre>