Sets a threshold in ArrayCollection where array is recreated if surpassed

this to avoid big arrays with all its references still set. This is an
artofact of the very purpose of ArrayCollection, that clear() should be
as performant as possible.
Fixes shutdown issue with TaskExecutor

where a shutdown caused by task failure might not be able to complete.
Fix broken test
Merge pull request #3655 from tinwelint/2.2-avoid-big-reference-array-arr-coll

Sets a threshold in ArrayCollection where array is recreated if surpassed
Merge pull request #3667 from tinwelint/2.2-bip-task-error-fix

Fixes shutdown issue with TaskExecutor
newline in the end of multi-line InputEntity toString
Better package for import-tool ComponentVersion

The ComponentVersion class for the import-tool was shadowing the one for kernel.
Produce fewer exceptions

This fixes two hot exception producers that popped up during performance testing.
This might slightly improve performance, but there's another benefit in that it removes two very noisy spots from the code, so we can get more interesting signal about rarer exceptions.

The CollectUserAgentFilter is only a problem during performance testing, where the load generators don't provide a User-Agent header.
Probably not an issue in production.

The ResultIterator was implemented in a way that required non-local control flow through lambdas.
This is implemented in Scala with trace-less exceptions.
Changing the logic around to no longer do an early return removes the need for this control-flow-by-exception.