Fix assertion failures with -p/-P and no server running there

Or more generally, catch errors from the psql run instead of running
into an assertion failure later on.
Handle unreadable/invalid postmaster.opts for -d/-D options