LUCENE-3917: Initial port of index pruning