Rescue errors that may be encountered when fetching encoding errors
requested to merge 1917-gitlab-ctl-pg-upgrade-can-fail-with-cryptic-error-messages-when-postgresql-is-not-running into master
If the user shuts down the database before running pg-upgrade, they currently get a stack strace. This change rescues the error and prints an appropriate error message.
Closes #1917 (closed)