Optimize logging and HTTP filter

Same as #2340, but now for 1.9-maint branch:
This PR primarily fixes so that isDebugEnabled is cached for Jetty and Neo4j calls. During testing with ApacheBench it was found that this gave 200%-1000% performance improvement on REST API calls, due to the excessive number of debug logging calls made by Jetty.

GCResistantCache.put had a debug log call with toString() that did not first check for isDebugEnabled, which caused a pretty heavy string calculation to happen even if debugging was not enabled. This has been fixed.

Also removes the security filter if no rules are configured.