Fix a bug where store migration forgets about legacy indexes.

IndexManager now also respects the availability guard (by virtue of transaction begin) when creating an index.