Tesla will recall nearly 135,000 cars to repair a computer memory failure that could pose a safety risk, US regulators said.