The looming closure of the Grangemouth oil refinery is a warning about the future of the oil and gas industry that both government and the companies involved must heed