There is no "first timeline"; there's only one timeline, in which Harry has always saved himself from the Dementors.
"I knew I could do it this time," said Harry, "because I'd already
done it. . . . Does that make sense?"
Harry Potter and the Prisoner of Azkaban, chapter 21: "Hermione's Secret"
Different writers have different ideas of how time-travel works and how it influences the past or the future. Some of these ideas are of changing timelines and alternate futures, shifting from one into another. The most notable example of these is probably Back to the Future, where changes in the past ripple slowly into the future. People can go back in time to change the past, then witness how these changes affect the future.
In the case of Harry Potter and the Prisoner of Azkaban however, there is a stable timeline that happens to be folded back on itself. The timeline "just is".
There is a loop, but the loop has always been and will always be there. Harry couldn't have decided to do anything differently the second time. The grandfather paradox does not exist in a universe such as this; because no-one has murdered your grandfather before your father was conceived, no-one ever will. This is known as the Novikov self-consistency principle.
Another example of this principle is found in The Terminator, where Kyle Reese has always gone and will always go back in time to impregnate Sarah Connor with John. Note that the sequels in the Terminator franchise muddy the waters and introduce changing timelines and paradoxes, but the first film is consistent.
For a more complicated example, try the stories by Robert A. Heinlein "By His Bootstraps" and "'—All You Zombies—'", the latter of which was adapted into the movie Predestination.