By listening to activists more than their own party’s voters, Democrats have been complacent in dealing with rising violence in American cities.