Fixed #22434 -- Retain ordering on custom manager subqueries

Thanks maciej.pawlisz for the report, and charettes for the review.
Used the Query.can_filter() for checking if there is a sliced.  If
can_filter() then we can also clear the ordering.