unstrip: Call adjust_relocs no more than once per section.
During symtab merging, adjust_relocs might be called multiple times on
some SHT_REL/SHT_RELA sections. In these cases it is possible for a
relocation's symbol index to be correctly mapped from X to Y during the
first call to adjust_relocs but then wrongly remapped from Y to Z during
the second call.
Fix this by adjusting relocation symbol indices just once per section.
Also add stable sorting for symbols during symtab merging so that the
symbol order in the output file's symtab does not depend on undefined
behaviour in qsort.
Note that adjust_relocs still might be called a second time on a section
during add_new_section_symbols. However since add_new_section_symbols
generates its own distinct symbol index map, this should not trigger the
bug described above.