LUCENE-6213: Add useful exception message when commit contains segments from legacy codecs (forward port from branch_5x)