Oil companies defeat New York City appeal over global warming