CO2 separation during hydrocarbon gasification