San Francisco morning commuters were taken for an unexpectedly wild ride after their train operator appeared to fall asleep at the controls.