Court upholds terrorism jail term for American in Peru