gold futures close higher as the dollar weakens