Fix permissions when restore run as root user.

When restore was run as root, pg_control was owned by root. A restore as root also failed when the base path did not exist.

Fix segfault on delayed connection errors.

A connection error that was delayed long enough to be reported on a later wait could cause a segfault.

Skip local repository duplicate check for SFTP.

The check for local repositories that are configured more than once was also applied to SFTP repositories, which are never local.

PostgreSQL 17 support.

17beta3 changed the control and WAL formats, which is unusual for a beta.

Do not allow help for command roles other than main.

Fix typo in user guide.