What to do about questions that are designed to embarrass the speaker?
Firstly, I should note that the examples you give are certainly somewhat agressively formulated (more so than would be common in my field), but not in themselves invalid questions. It is certainly "allowed" to be critical of the presented work, and there is nothing the session chair can or should do about this.

As a speaker, it always helps to think in advance what kind of "negative" question there could be, and prepare for them. You know that your work is very close to Foo et al, 2001? Good, have a backup slide that highlights your contribution over them. You think people would argue that a much simpler standard approach would have also worked instead of your super-complicated new custom method? Have a backup slide which compares the results of the two methods (you did test the standard method first, right?). If your answer does not convince the person asking the question, then much of what I wrote in this related answer also applies here. Specifically:


  (...) try to explain calmly why you did what you did. Yes, maybe that person asking the question will disagree, but so what? The fact that your actual peer reviews are good shows that there are a non-trivial amount of researchers that actually agree with you. The person asking the question is not your supervisor, you don't need to agree with him/her specifically on your research agenda or approaches.


As a session chair, you need to step in as soon as a question starts to become an ad hominem attack. That is, "I think this has been done years ago." is still fine, while "How the heck did you even get a PhD?" isn't. Further, a session chair should interrupt a series of questions as soon as he feels that the discussion isn't of interest to the larger audience anymore. I do not think that there is much that can be done in advance. As a session chair, you typically want to foster discussions, not preemptively set out the ground rules.

About the parts regarding sexisms and whether senior professors tend to be mean: I don't really have much to say about this. Not being a woman, I have not yet noticed any particular pattern about how females get asked questions versus males. The same is true for whether senior professors ask more critical questions - personally, I rather have the impression that fellow grad students and young postdocs or assistant professors are more likely to be extremely critical of other person's work than more senior researchers.