list slotdefs in offset order rather than sorting them (closes #17610)

This means we can remove our usage of qsort() than relied on undefined behavior.

Backport by Zbigniew Halas.
diff --git a/Misc/NEWS b/Misc/NEWS
index 9f145c7..3d9e9dc 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -9,6 +9,8 @@
 Core and Builtins
 -----------------
 
+- Issue #17610: Don't rely on non-standard behavior of the C qsort() function.
+
 Library
 -------