No, in that case they should do their damnest to arrest the person risking their lives if need be. If you're not prepared to do that then do not sign up for the police. As a police officer you definitely did not sign up to be judge, jury and executioner at the same time, 'Judge Dredd' is fiction, not an instruction manual.
Self defense doesn't give you the right to execute someone on the spot. On the other hand, what many in this discussion call "execution on the spot" might be legitimate self defense.
For self defense there usually needs to be some proof of a credible threat. Recent events indicate that this burden of proof is for some reason lower for police officers than for citizens.
"What do we want?"
"Dead Cops"
"When do we want them?"
"Now"