Better handling of failed libpq connections. Should fix the bug where a SQLSTATE of 08000 is expected but not returned.