Bug 913809 - Proper psql error handling

https://bugzilla.redhat.com/show_bug.cgi?id=913809

This adds some extra error handling when using psql in a scaled application if the database server is stopped.
Merge pull request #3034 from fotioslindiakos/BZ913809

Merged by openshift-bot