Changing the sorting for terms aggs,

This pull request fixes the sorting of aggregations as discussed in issue #5236.

It forces the `NaN` values to be pushed to the bottom of the list, no matter if you are sorting asc/desc. This way top lists show the most relevant aggregates in the top. Also it actually does what the comments above it already said it should do.

Closes #5236.