Gas-phase CO2 toward massive protostars