fix some inconsistencies in `sorted` from 2.4 implementation:
* ''always'' return a list, not the `reversed` generator returned when
reverse-sorting without a key function
* sorting should be stable w.r.t. the `key` function. When keys were equal
it was falling back to sorting on the original value