Ouch!
A slow death due to stun lock is frustrating.
Let's explore.
There's a comingling of three game issues in this post. Stun Mechanics, Stun Immunity and Companion AI,
First, the game's stun mechanic doesn't appear to work as intended. There appears to be an issue where you have to have at least 50 Spirit Resistance to get any benefit. And even if you do get some stun resistance, the odds are that you will still get hit with the full effect often enough to make stun lock possible.
Second, there are limited pieces of equipment that offer
Stun Immunity, and the skill
Battle Rage is for Warriors Only. The Cleric skill
Battle Prayer and all class skill
Spiritual Ward offers some stun resistance, but it's limited due the game mechanic issue above.
Third, Companions and Summons make terrible tacticians. There's a list somewhere of all the odd things Companions have done due to AI oddities. Note, they tend to have the same movement AI as monsters, so enemies can do the silly things, too.
Some things you can do:
Using spirit potions / equipment / skills will --in theory-- offer some stun protection but there's a debate if the game mechanic is working. And even if it is working, it requires an extensive investment in those areas.
Have elemental resistance.
Insane Wizard (Blue) hit with pure ice damage. So really high ice resistance buys you more time against their attacks, including up to infinite time if you have near maxed ice resistence.
Ranged Weapons: Giving Griss a bow can -sometimes- allow her to attack when you are blocking the way. Due to AI issues, not a prefect system.
AND THE MOST IMPORTANT THING TO DO:
Just don't play on Ironman.
Really.
It's that simple.
One of the many reasons I dislike the Die-Hard-Iron-Man mentality is that it's unrealistic, creates undue frustrations, and most IronMan players are cheating the perma-death so it's not like they actually playing ironman. They just want bragging rights.
Hard is the exact same game as IronMan, but with the nifty benefit that if there's a game issue, extreme bad luck, of real-world-inference, you still have the game.
That way if you die from an enemy, you're not screaming at the word about it being unfair, you can enjoy the monster's victory and learn from it.