Correctly handle ErrorResponse after one or more DataRows

Previously, if a query failed with an ErrorResponse after the server had
sent one or more DataRows, stmt.query() incorrectly returned
PgBadResponse.  Fix by handling the error correctly and returning it to
the caller.