EventLog Query (trac-12279) (rebased onto develop)



This is the same as gh-2511 but rebased onto develop.

----

See: https://trac.openmicroscopy.org.uk/ome/ticket/12279

The memory dump from the demo server had over 800MB tied up
in `char[]` all belonging to the `Launcher$AppClassLoader`.
Nearly all of them (>400K instances) were of the form:

  `select el from EventLog el where el.id > SOMEID`

That change is from roughly 2009 yet I've never seen
precisely this issue. Perhaps the recent move of the
`flush()` invocation was leaving more instances dangling.
In any event, this should collapse all 400K instances
down to one.

To test, check that the indexer process is progressing normally and that there is no undue memory growth. A snapshot of the heap (using `jmap -dump:file=somefilename.hprof $PID`) might be taken to look for growing numbers.