California gun owners raced to buy ammunition after court ruling