repair search lucene before installing

on the way to fixing search lucene migrations, see discussion in https://github.com/owncloud/core/issues/10205
Please add a comment explaining that it is intentional to not only do de-duplication but to remove all rows affected by duplication. E.g. rows `2 2 3` results in `3`, but not `2 3`.