The shooting deaths of two Connecticut officers and the wounding of a third punctuated an especially violent week for police across the U.S. and fit into a grim pattern: Even as more officers left their jobs in the past two years, the number targeted and killed rose.