Gold prices end slightly higher, tally third-weekly gain in a row