Shell has won its appeal against a climate court ruling that it must sharply reduce its carbon emissions.