Now deep breath, because I am about to share an uncomfortable truth:
you cannot fix this
Assuming that you opened your relationship ethically (big leap, I know), all of your partners are 1) grownups who 2) entered into nonmonogamy willingly and consciously. You are responsible for your behavior, but you are not responsible for your partners' happiness.
If you are utterly unable to keep from doing something, you can try what I think of as "humanizing the third." If primary & secondary/wife & girlfriend/Thing 1 & Thing 2 connect in some small way, they become much less of a threat to one another. It's easy to fear the unknown; it's harder to fear that person with the ridiculous screen name and terrific taste in shoes.
Suggest to your partners that they write to one another. Doesn't have to be big, doesn't have to be long, doesn't (and probably shouldn't) have any substance. Just give them one another's email addresses, and suggest they swap a message. Then step back and trust them. : )