gold ends higher for the first time in four sessions