Gold ends lower as stocks rally, but prices hold above $1,500