That's a nice ideal. I honestly kind of agree with you in the sense that I wish that was how things were. But in my view, it's easier to think about the police as a force whose primary purpose is to enforce the property rights of the capital holding class. In the United States there have been court rulings clarifying that police officers are never obligated to risk their lives.
If you look at the actual numbers, at least in the US, policing can really only be viewed as a risky profession from a white-collar point of view. According to OSHA, construction workers, truck drivers, farmers, and even pilots all have a greater likelihood of dying on the job.
I agree that's both the historical basis and continued reality of what policing is in the US (and also probably elsewhere). It's interesting to see how quickly and ravenously cops respond to businesses calling in reports, and crimes associated to the wealthy and powerful. Meanwhile someone can call the cops about their neighbor beating a spouse and they'll never show up and seem annoyed when they want to make a report.
If you look at the actual numbers, at least in the US, policing can really only be viewed as a risky profession from a white-collar point of view. According to OSHA, construction workers, truck drivers, farmers, and even pilots all have a greater likelihood of dying on the job.