Two frightening attacks in San Francisco have rekindled long-simmering concerns about public safety on the transit system.