If he saves baby Melody, he will rewrite his own timeline. He will never have been summoned to The Library as Ten, and thus anything after that should change for him. Unless it creates a paradox of two timelines, thus giving us a Doctor to be killed off...