Gold gains fourth day as geopolitics, data lift safe-haven demand