Those are rare. And even if you have 1000 humans surviving, it didn't happen.
What helps humans over dinosaurs: humans can live in extreme conditions (dinosaurs are very picky), and humans can conserve food outside of their bodies and live on it for a long time.
Humans are small and adaptable, dinosaurs are large and very fragile, as all big animals are.
Do you think we have millions of years to go?
Also, if we would indeed remain millions of years, and assuming continuous progress, I don't think an asteroid impact is a threat to that advanced human society, it's a simple matter or deflecting it/mining it until it's empty.
And in fact, forget about the deflecting and mining, that is maybe relevant in 10000 years. But in millions years, if we make it that long, I think human society will exist out of parts of civilization, technology, machine and mind floating around everywhere in the galaxy, spreading out at some rate. What does a single asteroid in some solar system even matter to that at all??