Energy dependence of pion and kaon production in central Pb+Pb collisions