make comp_hets loop more efficient and simultaneously fix duplicate comp_het variant pairs

I hope I understood the code correctly.  Never coded in Python before.  Apologies if I am wrong.