Add derived Eq instance to Database and Statement

The rationale is similar to IORef's Eq instance.  But a more immediate use case
is this:

    if db == Database nullPtr
Database.SQLite3.Direct (open): fail if sqlite3_open unexpectedly returns NULL

Now we can ensure that no null pointers (other than empty strings) leak through
the .Direct API.
test: Add more tests to testBindParamCounts

Properties:

 * Gaps due to numbered parameters may cause bindParameterCount to return a
   number greater than the actual number of parameters.

 * ? takes the highest index of all preceding parameters (not to be confused
   with the index of the preceding parameter by itself), and adds 1 to get its index.

 * bindParameterCount returns 0 if there are no placeholders.
test (testBindParamCounts): Factor out 'testCase' to reduce duplication
test: Add testExec

Properties:

 * 'exec' silently succeeds when query string contains no statements

 * 'exec' with multiple statements performs all of the statements
test: Tighten testBindErrorValidation to only accept an error caused by 'fail'
test: Add testPrepare and testCloseBusy

Properties:

 * prepare 'fail's if given a query with no SQL statements

 * prepare only reads the first statement.  Subsequent statements are ignored.
   TODO: make this 'fail' instead?

 * If you try to 'close' a Database, it will fail with ErrorBusy if there are
   any statements that haven't been 'finalize'd yet.  After this,
   trying to 'close' again after finalizing statements will work.
test: Extend testPrepare, and add testErrors

Properties:

 * prepare conn "BEGIN; ..." does the BEGIN, and only the BEGIN.

 * Violating unique or not null constraint throws ErrorConstraint.

 * If parameter index for bindSQLData is out of range, it throws ErrorRange.

 * If column index for 'column' is out of range, it returns SQLNull.
test: Extend testErrors

Properties:

 * Binding SQLNull to an out-of-range index fails with ErrorRange, just like
   any other type.

 * bind stmt [] works when the query has zero placeholders.

 * Binding to an index that is in range (<= highest parameter index), but is
   not used, succeeds.
test: Add testColumns

Properties:

 * columnCount returns the number of columns in the result set before ever
   'step'ping, but don't rely on this behavior.

 * When 'step' returns a 'Row', this row and subsequent rows should have the
   same 'columnCount', even if columns are added during the query.

   In other words, the first 'step' locks in the number of columns for the rest
   of this query.

 * For an empty result set, you can use the 'columnCount' after
   step returns Done.

 * Columns may be added while a statement is stepping through the table.
test: Extend testErrors to test trying to drop the table while stepping through it

These tests demonstrate how a sqlite3_stmt can be "running" or "not running",
and how it can lock resources that it's using.

Properties:

 * exec conn "DROP TABLE foo" succeeds if a prepared statement references foo,
   but isn't running.

 * exec conn "DROP TABLE foo" fails if a prepared statement is running and
   reading foo.

    - ErrorLocked if called from the same connection.

    - ErrorBusy if called from a different connection referencing the same
      database.

 * A prepared statement is still running after 'step' returns 'Row' for the
   last time.

 * A prepared statement is done running after 'step' returns 'Done'.

 * sqlite3_reset does not report an error when the query is currently invalid
   (e.g. missing table).  Instead, the next sqlite3_step call will report an
   error.
test: Add testIntegrity

Properties:

 * Empty values (0, 0.0, Text.empty, B.empty) are treated as values, rather
   than null.

   This is remarkable, given that Text.empty and B.empty are represented
   internally with a null pointer.

 * Minimum and maximum bounds for each type don't get truncated.

 * SQLite3 turns 0/0 (NaN) into SQLNull.