Avoid reordering when unnecessary. Fixes bug #562429
The existing code would do a full iteration over all pack indexes (for all of rix/iix/tix/cix/six), just to generate a list that was in the same order. Instead, we now only trigger a re-order when we know something has changed in the local index.