Order BY is not compatible with all DBs

This prevents updates to a newer version when running on a DB that does not support ORDER BY in delete queries.

@karlitschek Requires a backport to stable7.