Sonic is the enduring hero of his series, and the games are built around him always finding a way to win, so his "death" is not really part of the story. Within the fiction, Sonic's determination and speed almost always carry him through any danger.
So rather than a grim outcome, think of it this way: as long as Sonic keeps running, his adventures—and the fun—continue. He is designed to be the character who never gives up.