Favor off-heap over on-heap LongArrays

to reduce unnecessary strain on GC, since these arrays often come in great
sizes.
Doesn't write page in batching page cache if there are no changes
Less garbage around encoding/decoding labels for nodes
Generic store processing steps in batch immporter
Ability to release memory at will in the batch importer

by making sure that only the ParallelBatchImporter holds references to the
high-volume cache objects and so can release them by setting to null.
Batch importer stages added for populating count store
CSV input integration test verifies counts after import
Also tracks ANY counts in ParallelBatchImporter
Exposes static method for reading high id from id file
Extended StoreFile#move into #fileOperation with either COPY or MOVE
StoreMigrator can tell batch importer things about the legacy store

High token ids which are essential for some calculations inside the batch importer
to know those high ids up front.
Also the last committed transaction id, so that the counts store is marked
with that id when writing it.
Fixes a label cache issue where high label id was 0

Also made LongArray#setAll more convenient to use by returning itself.
Writes to log channel under synchronization

the actual writing of a buffer to a channel was optimized to be done
outside of the logFile monitor in b549c380817e5be0159698f57743ae10331a6568
which worked for everything, except getting the correct log position for
appenders, at that time, appending at the same time as the position was
updated in the background by the batched writes thread.

I still believe there can be made an optimization just like it, but for
now just writing the buffer inside the monitor solves the observed race
which would lead to poisoned transaction metadata cache.
Merge pull request #3332 from tinwelint/2.2-tx-metadata-cache-poison-fix

Writes to log channel under synchronization
Merge pull request #3312 from tinwelint/2.2-bip-counts

Batch importer updates counts in counts store
Expose a way to ask a lucene index to sample index selectivity

o Scan a sample of index entries and compute uniqueSampledValues / sampleSize
Add a new CountsKey for index entry counts
Maintain index update counts from index proxies

o OnlineIndexProxy will ensure that the index counts are updated
o Fix bug when generate LazyIndexUpdates to never construct 'overlapping updates'
o Cleanup code in LazyIndexUpdates
o Make sure we update index update counts during population
Add minor version to CountsStore such that we can flush safely on index flip (outside of log rotation)

o Ensure we compare CountsKeys correctly by type
o Fix reading of index keys
o Add flushIndexCounts() to IndexStoreView
Remove index counts when dropping an index