By browbeating Mexico and inflicting the pain of a protracted trade war, Trump risks alienating a necessary ally and friend.