This code was refactored in d5497b95 but an extra LWLockRelease call was left behind. Per report from Erik Rijkers
Hopefully this makes the *BSD buildfarm animals happy.
This is just refactoring, to make the functions accessible outside xlog.c. A followup patch will make use of that, to allow fetching timeline history files over streaming replication.