#15545: sort iterdump via SQL instead of in python code

Although there is not a regression in Python2, we make the same update here to
keep the code bases in sync.

(The fix for issue 9750 introduced a regression in Python 3 by sorting the row
objects returned by fetchall.  But if a row_factory such as sqlite3.Row is
used, the rows may not be sortable (in Python3), which leads to an exception.
The sorting is still a nice idea, so the patch moves the sort into the sql.)

Fix and test by Peter Otten.
diff --git a/Misc/NEWS b/Misc/NEWS
index 7e29e54..6bb2549 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -186,6 +186,10 @@
 Library
 -------
 
+- Issue #15545: Fix regression in sqlite3's iterdump method where it was
+  failing if the connection used a row factory (such as sqlite3.Row) that
+  produced unsortable objects. (Regression was introduced by fix for 9750).
+
 - Issue #16828: Fix error incorrectly raised by bz2.compress(''). Patch by
   Martin Packman.