I think when one is in the heat of such a dire situation, one wouldn't have the time to think so thoroughly of how not to harm the perpetrator and avoid being killed at the same time. Such situations would usually involve the other party because in heat of anger and one is unable to listen to any explanations or reasoning.
Therefore, I would be fighting for my life and sometimes in the heat of things, accidents do happen. No one wants to kill but when we are left with no choice, we just have to kill and live with the fact that we killed to survive. When the killer is so adamant at getting us and we have no choice, we just have to kill him or get killed. What choice do we have? I doubt any of us will open our arms and allow ourselves to be sacrificed unless we are living Bodhisattva.
I think, once we had committed the unthinkable, it is living with it. There's a lot of things we could have done but once it is done, it is done. Murder is one of the most severe actions and it takes a lot to purify such negative karma. It is said that Yamantaka practice is an extremely powerful purification method that it is able to purify actions of the 5 heinous crimes - killing our father, mother, arhat, bodhisattva or drawing blood from a Buddha.