US court upholds conviction of ex-Gitmo detainee