Locking in future prices can be expensive — and risky. But it can protect producers and consumers from price spikes.