Tom Riddle, while extremely paranoid, was also extremely arrogant. In his Hogwarts years, he created one of six planned magical safeguards. This first safeguard was his diary, where he had been pouring his heart and soul for long before he had ever conceived the idea.
By 1981, it was still the only safeguard he had created. He wanted the others to be created only under special circumstances. Only the most valuable and sacred objects could do; he already had those. He also wanted to use only the most sacred lives; his first murder was one, perpetrated while doing Slytherin’s noble work. He had yet to find the others. Filthy muggles were not worth the honor, no matter who they were. Nor were average witches and wizards who stood in his way.
Then the prophecy arrived; a child destined to be his rival. This would be the perfect death to use next, wouldn’t it?
He never got the chance. His curse backfired, and his soul was not as unstable as it would have been if he had, say, created more than one safeguard. Little Harry Potter was left with a scar but nothing more.
There was only the one safeguard, left in the possession of Lucius Malfoy. The diary.
In 1993 in a chamber hidden beneath Hogwarts School of Witchcraft and Wizardry, Harry Potter, the boy destined to destroy the Dark Lord, plunged a dead basilisk’s fang into his diary. The book bled black ink. The shade conjured from the diary writhed and disappeared.
Deep in a forest in Albania, a wraith writhed and disappeared as well, its tether to earth cut.
After Harry Potter had left his office, Albus Dumbledore examined the diary. He wondered and, very carefully, he hoped.
In 1994, Sybill Trelawney did not make a second prophecy. Also, for the sake of it, let’s say someone (probably Hermione) had the foresight to put Wormtail in a Full Body-Bind. And Remus remembered, if not to take his potion, then that he was due for his time of the month. Sirius and Remus spent the full moon together in the shrieking shack, just like old times. With more difficulty (Snape was still unconscious and Ron’s leg was broken) they began to take Wormtail back to the castle. When Snape woke up, there was no werewolf. For all of Snape’s faults, he knew he couldn’t get away with not helping, so he helped get Ron and Wormtail back to the castle, sniping and ranting the entire way.
Sirius was cleared. Remus did not lose his position.
Dumbledore wondered, and his hope grew.
Or: A combination of good and conveniently bad decisions conspiring to create happy endings from former tragedies.