reindex bug fixing (rebased onto develop)



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

----

To test, check the command-line options for `bin/omero admin reindex -h`
and make sure that each command runs as expected, and exits cleanly.

Additionally (ticket 9800) it should be possible to restart the server
while a long-running index is taking place.