Index sort tweak: search before sorting sticky/pinned threads.

That way we only have to sort the matched threads when searching.