Fix t5986-test breakage by new HashSet

Seems like a set should not replace elements when adding already existed element, so we need to comply.