If you know you're a little difficult to be around the moment, have you tired simply apologizing? It sounds like you want to make things better and sometimes the first step is being the first one to admit you are contributing to the problem. One thing I've found works with my husband when he shuts me out, is to first apologize for my contribution to our current problems then explain some of the things he's doing to contribute. It helps him not to feel like I'm attacking him when I admit my culpability first. I can't count how many times it's stopped a fight before it starts. Make sure he knows how you're feeling, but don't start the conversation emotional or combative, and really to avoid hitting the combative or defensive levels. Emotions fine as long as you don't go into battle mode.
If you are anything like me, he shuts down when you go into battle mode, because it's just happening more often. Luckily for me and my husband we've been through the cycle a couple times so I've developed a strategy about how I need to adjust my behavior to reopen the communication lines.
All you can really do is try to control how you act. I know how difficult pregnancy is and how its easy to have a bad attitude especially with our partners because that's who we are most comfortable with but its no good for a relationship. You get what you put out so as tough as it can be next time he upsets you try to let it roll off your back and focus on the positive. I've had to teach myself to stop, breath, and think before I react to situations.
I dealt with this with my first baby.... but he will realize what you are going through to have the baby, especially if he is present for your labor n delivery, and hopefully he will be more appreciative and patient
Why aren't you a "peach" to be around? Honestly, in my first pregnancy other men said steer clear of your wife, she'll be difficult and nasty, but I never ever was and he just looked at them with blank stares.
Advice? Stop being mean to him. Really.