comex gold logs first gain in four sessions