The US Supreme Court upheld a federal law banning the app unless it is sold by its China-based parent company.