gold closes higher, ends two-day losing streak