I'll be the first to wade in. If you have any experience working in various venues, you are bound to come upon someone doing this. I have on many occasions, although fewer over the last several years.
I feel there are two ways to think about this:
1) You should have your "set" tight enough that the opportunity never has a chance to emerge. If you are in clear control of your situation, it is much more difficult for someone to try and join in. (As a side note, if your material is strong enough, then they won't be tempted either.)
2) One of the primary reasons, I feel, this happens is lack of manners. I have been in social situations where, unbeknownst to me, a magician had been hired to work the room. Do I try and one-up them? Absolutely not. If my friends ask me to do something later, I ALWAYS demur, saying that this is his/her room, and it's not my place. Even if it would be out of sight, I still demur out of common courtesy.
The people who feel they need to pile on to your momentum are generally boorish in other aspects of their life as well, and have pronounced self-esteem issues.
They feel somehow "lessened" by your skills, and need to thump their chest a little. I'm sure this attitude bleeds into other aspects of their life; work, sports, personal relationships, etc.
Almost 100% of the time when this happens, I can see by the faces of the group that they know this person's tactics, and know that this will not end well. Therefore, you are in a no-lose situation.
1) You can be magnanimous, and allow the person to perform and comment politely when the performance of the 21 Card Trick ends (or fails, as is often the case).
Or 2), they actually have some chops and do something good. Then you are equally polite and comment in a friendly fashion about how lucky you are to have seen them work. Personally, I've never had this happen, but I'm prepared for it to happen some day.
I'm sure that I've been working a party when a fellow professional, unknown to me, has been in the room. And the reason they remained unknown to me was because they were polite and kind enough NOT to ask for some of the spotlight and were mature enough to allow someone else to be the center of attention.
Bottom line: YOU must remain calm and civilized and take it all in stride. No matter what the outcome, you'll end up looking like a professional and an adult, and keep the audience's respect.