Finding oil and gas to replace the world’s fast dwindling reserves is increasingly risky as rigs probe areas once seen as too difficult or too dangerous, and costs are rocketing, which could imperil future supply.