New York court rules New York City can end housing subsidies