Zoejory
I think the best way to avoid this issue is to totally ignore anyone you know.
Love it, Zoejory - I now have an image of various gransnetters leaping into bushes to avoid people they know 
I'm another one who has gone into the doctor's and replied "Fine, thanks" to their greeting of "how are you?" It was my standard reply for many years and came out without me even thinking about it! I have now learnt to say "not too bad" on those days when I'm feeling anything but fine.
I have found, in recent times, that I have to be careful not to off load on anyone and everyone. I'm in the middle of a long term (very) stressful situation and am quite isolated due to health. So any poor soul that even vaguely knows me is at risk of getting chapter and verse should they even just smile at me... When you don't have anyone to offload or vent to, it is almost as though you have to 'get it out' any way you can.
Years ago as a psychotherapist, I often got clients who would offload on me every session. And that was actually their therapy. It is well known in the talking therapies that just offering the space for someone to do that can be as effective as any kind of 'therapy'. Although I agree, it can be frustrating when confronted with someone doing that when all you've done is greeted them on the street or in the supermarket.