Performance Tweak: Use query to replace get_posts in get_product_ids_on_sale.

The query that get_posts generate will join the postmeta table twice, which is slow and uncessary.