Correct history file parsing.

Fix a history file parsing error which prevent parsing the hole history file.

This commit should fix errors when reseting a old master with timeline id > 1
and new master with timeline id >2.

Formerly the error message "could not find common ancestor of the source and
target cluster's timelines" was printed.