Keep track of Lucene and index schema versions

Like SchemaVersionCheck, use a LifecycleManager to check the schema
versions on startup. We need to check both:

 - The on-disk format of the Lucene index. We specify the current
   version manually in LuceneChangeIndex, since Lucene itself doesn't
   store a version in the directory. (CheckIndex claims to be able to
   detect an out-of-date index file format, but it seems buggy.)
 - The version of the ChangeField schema, which indicates the
   semantics of the various fields.

Persist both of these versions in a simple config file,
index/gerrit_index.config.

If the check fails, inform the user they need to reindex. Rewrite
Reindex to delete all the files in the Lucene directory, not just the
documents.

Change-Id: Ib82b8aab21c819db3625cd9984262a40135e0894
5 files changed