PetroChina Co. posted its best ever quarterly profit as China’s largest oil and gas producer benefited from rising energy prices due to the war in the Middle East.