This fix required sorting all of the LIB_PART draw items to ensure
accurate comparison between the symbols stored in the schematic and the
original library symbols. This has a noticeable impact on symbol library
load performance. It may also cause significant changes the next time
the library is saved due to changes in the draw item sorting. Hashing
may be a better solution here but this addressed the immediate problem.
A skeleton method SCH_SCREEN::SwapSymbolLinks() was added because there
is most likely an issue with orphaned symbols in the schematic library
symbol cache during undo/redo operations. More testing is required to
verify this.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/7263