US court upholds terror ban