The police in Arvada, Colo., said a good Samaritan who fatally shot a gunman who had just killed a police officer was himself shot by responding officers.