Add some functions to get the current TLI.
Having lots of code that relies on the ThisTimeLineID global variable
is problematic, but to have any chance of fixing that, we must provide
another way for code outside xlog.c to get the relevant value. This
commit adds a GetCurrentTimeLineID() function for that purpose, and
also modifies GetFlushRecPtr() to return the same value via an output
parameter, since that looks like it will be convenient in some places.
This commit doesn't actually reduce use of ThisTimeLineID at all; it
just provides infrastructure that future commits can choose to use
for that purpose.