The argument from the pro gun side isn't that guns can sometimes help someone in some situations. It's that when someone gets shot, "if only they had a gun" they would be alive. This proves that's bull because you can't know what would happen in a counter factual. If there were very few guns in society, maybe these shootings never even would have happened. That's another, equally valid counterfactual.
It's obviously true that having a gun won't guarantee a 100% chance of not being killed (nothing will), but in most situations it does improve your chance of survival significantly. Not in this case due to the logistics of the situations but still, if the cops hadn't had guns the probability of their survival in an alternate universe would almost certainly be lower.
As for your counterfactual, sure, if there were no guns, there would be no shootings. But, that doesn't equate to a sound argument for gun control because it assumes that gun control will get rid of guns, which is up for debate. In this case, for example, the murderer's gun was very likely owned illegally, since it's extremely difficult to get a handgun license in NYC and the guy had a history of violating gun laws.