I did once avert her turning hostile, though I've never managed to repeat it so I'm not sure what I did or if it was just random. I'm still loath to kill her (or whatever's left of her) so I just leave her be and have all my characters flee combat to break off hostilities.
It would be nice if it was possible to actually save her, but I think it's scripted to happen regardless.