xlog.c: Adjust some more functions to pass the TLI around.
Adjust ReadRecord() to take the replayTLI as an argument. Use
that value, rather than ThisTimeLineID, to set the minimum
recovery point TLI. Also pass the value through to ReadRecord()
via XLogPageReadPrivate, and from there pass it down to
WaitForWALToBecomeAvailable() and rescanLatestTimeLine(),
so that the latter doesn't need the global variable
ThisTimeLineID either.
To make all this work, a few other changes are needed. First,
pass a TLI down to ReadCheckpointRecord so that it can pass it
on to ReadRecord. Second, have read_backup_label() return the
timeline it obtains from the backup_label file and install
that temporarily as ThisTimeLineID. The reason for the latter
change is that, previously, ThisTimeLineID could be
uninitialized when ReadRecord() was called, as when we were
reading the checkpoint record. Though that seems to have no
consequences about which we need to be concerned, it's better
to have a legal value all the time.