Repsol to sell upstream unit stake for $5bn to US investor