Oh, another option (just not a perfect one): wish for a potion of red dragon control. It's a simple, very "mild" wish. The dragon would get a save, at -2, which would be a 25-35% chance of the potion working.

In addition to temporarily neutralizing the dragon, this can also deal with the efreeti by turning the dragon against it, while you make good use of the other two wishes to raise the dead and get to safety.