Gold prices drifted between small gains and losses Wednesday, anchored by the U.S. dollar.