I think the key to this one is that a gravid female should be on her own as she gets close to giving birth. It's always seemed like a sensible precaution if a gravid female is cohabitating to move the rank mates before the female gives birth.