Gold prices end with a slight loss as U.S. equities, dollar gain ground