Republican lawmakers in Arizona have prevented Democrats from reversing a law from 1864 that bans abortion.