Stop trim_mean sorting the caller's list in place (#8199)