Dollar gains; Canadian, Mexican, Chinese currencies retreat on Trump tariffs talk