Gold finishes lower as stocks rally, dollar strengthens