Gold ends slightly higher North Korea threat, but posts weekly decline