Fix a memory leak in RerferenceCache

The leak was caused by the fact that when inserting new data in the cache
noone is cleaning up the old GCed values still present in the cache.
Indeed the cleanup was triggered only by updating existing node which have
been GCed or at some extend by getting GCed values.

This PR also tries to improve the polling when during get/remove by looking
to the whole queue instead of just removing the single element.
Merge pull request #2695 from davidegrohmann/1.9-fix-leak-ref-cache

Fix a memory leak in RerferenceCache
Merge remote-tracking branch 'upstream/1.9-maint' into 2.0-maint

Conflicts:
	community/kernel/src/main/java/org/neo4j/kernel/impl/cache/Cache.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/cache/NoCache.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/cache/ReferenceCache.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/cache/ReferenceWithKey.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/cache/ReferenceWithKeyQueue.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/cache/SoftValue.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/cache/StrongReferenceCache.java
	community/kernel/src/main/java/org/neo4j/kernel/impl/cache/WeakValue.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/cache/ReferenceCacheTest.java
	community/kernel/src/test/java/org/neo4j/kernel/impl/cache/TestCacheTypes.java
	enterprise/ha/src/main/java/org/neo4j/kernel/impl/cache/GCResistantCache.java
Merge pull request #2700 from davidegrohmann/merge-1.9-into-2.0

Merge 1.9 into 2.0