Prevent NullPointerException when calling request.logout (Tomcat) for Servlet 3+