losing mucus plug and sex

I'm a ftm and just lost my mucus plug. Is it okay to have sex after you lose your mucus plug? I was told that I shouldn't because there is a higher chance of infection since the mucus plug helps prevent infection. I'm 39+4 and we have been having sex to help move things along, I also heard it's safe to stay intimate up until the baby is born. Is there any women out there who can shed some light on this subject?