Fix #23406: Crash on copying multiple selected chord names.

Fix #23406: Crash on copying multiple selected chord names.

The map key used to sort by track and tick the elements to copy overflowed.