[ticket/12966] Sort by post_time and post_id where applicable

This change was not applied to the search as this would require a larger
rewrite of the search methods.

PHPBB3-12966