Treat this person as you might a small child who is a bit unable to follow...
EG "yes that's right I'm a rubbish person who says stupid things. I'm always getting told off"
You: When did I say that Auntie Betty/cousin Luke/Father in law Terence... I said we don't call kids scabby little nit wits because it is upsetting for them and knocks their confidence, I am sure you can say loads of encouraging things about Leonora’s/Thomas's/Jessie’s appearance/ home work/new Futsie 500 company!
Try not to get stressed, just say what you mean and mean what you say, say it with a smile and if they totally rail road over you with self depreciating comments you need to just say.
"I think I am being quite easy to understand here, those types of comments aren't helpful, I am not saying anything nasty about you, just that we don't say things like that in front of the kids....."
You could try a straight face to face, it's difficult when you blah blah blah, but my guess is this might be seen as an attack so better to keep it light hearted and always relevant to the point.
Although I love Aussiebean's ' well if you are always saying things like that, maybe you should look into some councilling so you learn how not to do it' I’d be tempted to tone it down and just say
...
"I think we all have to just think a bit more about what we say in front of kids these days, they are very aware of what adults say and it's our job to be positive and encouraging with them."
(For the record I think that is true! My uncle and dad used to talk about things that were not appropriate, scary stories, watch things n TV not really suitable for kids, and my mum rarely seemed to notice. Me and my sister were much more vigilant about kids not watching inappropriate stuff! Also a kids we were often out playing, in the garden etc etc,
I think nowadays kids are maybe around adults more, my kids stay up later than I ever did and they are often listening in , in a way I feel my sister and I never did. I just feel hat nowadays too we are more aware, how hurtful comments, inappropriate language etc can affect children. Fundamentally, society hasn’t changed but we do now afford ids more respect than we did when I was one, IMHO!)
Can you give us an example of what they say!!??