Although the cop made the correct decision in that the attacker had no weapon, he could have guessed incorrectly and paid the ultimate price himself.
As for the attacker, if he really wanted to die at the hands of the cops surely all he had to do was run at him rather than waiting to be arrested.