US Defense Secretary Jim Mattis quits as President Donald Trump weathers an escalating backlash at home and abroad over his sudden decision to pull all troops from Syria.