Handle connection failure correctly

  - In pgsql_connectdb, if lua_newuserdata failed, the connection object would leak
  - In pgsql_connectStart, PQconnectStart could have returned NULL, and the user would have an invalid connection object