Fix assertion failure if timeline switch happened at page boundary.

If the master and standby diverged at a page boundary, we would start the
scan for the last checkpoint record at the page boundary. XLogReadRecord
is not cool with that; it expects there to be a valid WAL record at the
start point. To fix, skip over the page header.
Refactor test suite.

This makes it easier to write separate test cases, instead of doing
everything as one test case.

The pg_rewind.sh script has been split into several parts. Initialization
happens in config_test.sh, and actually running the test in run_test.sh.
The test case -specific logic is in "basictest.sql", which defines four
functions describing the things to do in various steps in the test, and
calls config_test.sh and run_test.sh

Create the log files with predictable names. I don't think there's much
value in keeping old logs - we don't keep the regression.diffs file either,
for example.
Handle creation/removal of directory trees correctly.

If there is a directory with files or subdirectories in it in the source
that are not present in the destination, we will remove them all. But we
must be careful to remove the contents of the directory before the directory
itself, otherwise rmdir() failes with ENOTEMPTY.

Also add a test case for that.

I believe this fixes issue #34 reported by Thom Brown, where a subdir in
pg_replslot was present in source but not destination.