Thousands of people took to the streets in US cities in protest against fatal police shootings of two black men this week.