A fertility rate of 1.7 isn't the same as 'not reproducing' and doesn't imply 'going extinct'. You can't just extrapolate a trend at any given moment indefinitely. Otherwise if you pick a moment of rising population you'll extrapolate up to infinity or if you pick a moment of falling population you'll extrapolate to zero. Reality doesn't work like that. Arguably it's just a trend towards right-sizing the population.
Globally fertility rates have been falling for many decades. It's hardly surprising that the poorest countries are among the last to see fertility rates decline the most, but as income and education rates in those regions rise, their fertility rates will also fall.
As a for secularization, which you seem to conflate with social progress, counting 'Muslims' and 'Christians' isn't a simple exercise. Counting everyone born to Muslim parents as Muslim doesn't make any more sense than counting everyone who gives presents at Christmas as Christian. In fact attendances at Mosques and actual participation in religious activities is in decline across most of the Muslim world. In Europe most 'Muslims' do not pray every day. Egypt is a good proxy for trends in the Muslim world due to it's cultural influence. There are steep declines in religious practice and support for imposing Sharia Law has more than halved over the last decade.