Investigating whether the environmental Kuznets curve hypothesis holds for sectoral CO2 emissions: evidence from developed and developing countries