Court reverses ruling bringing 17 Gitmo detainees to U.S.