Fix the condition on the occurrences_set_latest rule.

The rule currently written updates all the bugs if they occured before the new occurrence.

The updated version makes sure that it only updates the bug associated with the occurrence.