gold ends at record high on weaker stocks, outlook