Gold ends slightly higher, halts 3-session skid