Gold stages late-session pivot to end higher as U.S. stocks tumble