DEV: Refactor `TopicView#filter_posts_by_ids` to not apply ordering. (PR #14617)

The post_ids array passed to TopicView#filter_posts_by_ids have already been sorted so we can just maintain the ordering backed on the sort order in the array. This is done so that TopicView#filter_posts_by_ids does not impose any ordering on the post_ids allowing us to pass an array of post_ids that may be sorted differently.


post_ids is limited so time spent for the Ruby option should be negligible