Gold set for second weekly gain as dollar weakens