If we wipe ourselves out within 100,000 years, I'm not sure "intelligence" is a particularly advantageous trait, evolutionarily-speaking.
But the next is not far away, just a few light years. Maybe we'll see this in the next comedy . So far it's only in a Stanislaw Lem novel.
Anyway, even if that always happens, that seems a bit too large a hill for evolution to notice it's not a global peak and route around. Unguided genetic evolution is scarily efficient, but not that much.
(Funny thing that memetic evolution may be able to make that decision, but if you are right, it's the problem by itself, so it couldn't fix it.)