At the end of their lives, oil and gas wells need to be plugged. But it can be expensive and doesn’t always work.