Bug 963508 - Don't directly remove elements while iterating on a set (r=wesj, a=sylvestre)