Send him out when he's grumpy. Unless you want to put up with that you'll need to teach him what you're willing to tolerate. A walk, to coffee with a friend, who cares where he goes, just as long as he knows you don't want him near you (and in the future a potentially sleeping baby) when he's being bitchy. If there's a consequence, he might try to behave to be around you more often.
Saying that, you'll need to be respectful to him and bow out when you're feeling crabby. Go read or do something on your own. When he comes asking about you, let him know you prefer to spare him your misery. If he still wants to snuggle you then that's ok but you'll teach him about being respectful by modelling it yourself. In the end, you'll likely still spend as much time with each other, the difference is you'll be more respected, he'll be trying hard to behave well, and you'll have an agreement that when things do go sideways you can take a breather rather than risk your pregnancy staying in high stress temporary situation.