gold futures end lower, gain for the month