It's happened to me a couple of times, particularly doggy-style. It seems like it happens when he starts to go soft but stays in. When he comes out there is a definite passing of gas...lol.
I was initially embarrassed but now we just laugh about it and tell him it's his fault...