Gold ends higher as tensions between U.S. and North Korea weigh on the dollar