The US president has caved after threatening to slap his closest allies, Canada and Mexico, with major tariffs.