Correctly responds to inactive update puller

There are different use cases for the update puller. Some cases are OK
with observing the puller becoming inactive while awaiting the condition,
others aren't. This different existed already, but only as a check before
the call and inside await an exception was thrown when this happened. This
commit moves the difference in handling an inactive puller into await
where the caller can decide how to handle it.
Log rotation won't happen on kernel panic

Log rotation checks that the kernel is still healthy, while having the
logFile lock, before doing the rotation. This to be on the safe side in
the event of panic, ehere the next recovery will have a chance to repair
the damages if all transactions are still in the active log.

For this the TransactionAppender#append method decides on success or panic
while holding the logFile lock and therefore safely communicates this
state to any log rotation happening concurrently.
Make sure that Table-bound resources are released when a primitive collection is closed
Fix an use-after-statement-closed error with USING PERIODIC COMMIT
Equals and hashCode for primitive collections

Also fixes the PrimitiveIntLongVisitor and PrimitiveIntLongMap.visitEntries, such that visitation can throw custom exceptions or be halted midway.
Merge pull request #3701 from tinwelint/2.2-dont-rotate-on-failure

Log rotation won't happen on kernel panic
Merge pull request #3706 from jakub-/user-after-statement-closed

Fix an use-after-statement-closed error with USING PERIODIC COMMIT
Merge pull request #3702 from chrisvest/2.2-prim-coll-eq

Equals and hashCode implementations for the primitive collections
Merge 2.1-maint in master
Introduce a TransactionTemplate for automating transaction retries.

Changed a flaky test to use the transaction template to avoid unnecessary breakages.
Merge pull request #3696 from tinwelint/2.2-update-puller-inactivity

Correctly responds to inactive update puller
Add query logging.

Three new options added
- dbms.querylog.enabled, if true log queries, defaults to false
- dbms.querylog.filename, the file where queries are logged, defaults to `queries.log`
- dbms.querylog.threshold, only log queries that run slower than threshold (in milliseconds)
  defaults to 0, i.e. log all queries.

 This is an enterprise feature.
Merge pull request #3656 from rickardoberg/retryflaky

Introduce a TransactionTemplate for automating transaction retries
Merge pull request #3661 from pontusmelke/log-queries

Add query logging.
Revert "Disable varlength planning in Ronja and fallback to the legacy planner"

This reverts commit 090c8775e53a0edf413b891827cb610269bd8f93.

Conflicts:
	community/cypher/cypher-compiler-2.2/src/main/scala/org/neo4j/cypher/internal/compiler/v2_2/planner/logical/expandsOrJoins.scala
	community/cypher/cypher/src/test/scala/org/neo4j/cypher/MatchAcceptanceTest.scala
Decouple compiler version and planner version

To control language version `CYPHER x.y` and to control
planner we have
```
PLANNER COST
PLANNER RULE
```
By default we use a variant that uses what we currently is known to be safe in COST and
fallback to RULE when we are at risk of creating slow plans. Currently we don't do varlength,
cycles and updates in COST.