America has always had that many guns, but the police weren't always militarized. In addition, the amount of crime and number of police killed in the line of duty has steadily decreased over the years.
The devil's advocate in me wonders if the number of police killed is reduced because of the heavy use of SWAT whenever they think there might be any threat to an officer in a raid.