Mazda is to recall 1.2m vehicles in the US for defective ignition switches.