As far as I know, 100% of the time, in the past, the candidates for the office of President were "cemented in" by the convention. There are, I'm sure, election laws that pertain to timing of announcing candidacy, etc. But the DEM party will obtain judicial exception, or just plain "do it," as they see fit to reach their goals.
See widow Carnahan (not on the ballot), Toricelli/Lautenburg (candidate change, no infirmity, AFTER the people selected Toricelli in a primary). My point is that it's a mistake to underestimate the depravity of politicians.
As a practical exercise, imagine what could happen if, 25 days before the general election, Kerry up and says, "I quit." Do you think the DEMs would settle for having no candidate? What would happen if they asked for a mulligan, and were told, tough noogie, your guy quit? I can't imagine how much anger that would create, and the anger would not be directed against Democrats.
That could get really difficult.