gold futures end higher, but post a weekly decline