MDL-51110 badges: prevent duplicate award of badges
MDL-51110 badges: prevent duplicate award of badges

Previously duplicate users could be returned when they had
done duplicate badge criteria - this would lead to a duplicate
constraint being hit as they were attempted to be awarded twice.

dilawar/moodle