smartplaylist: Respect sort terms in queries.

This should fix #1137.