Using number of keys to grow/shrink tables.

A new atomic field, nkeys, was added to the DbTableNestedHash
struct. It counts the number of distinct keys in the tables and
is used to control when to grow and shrink the table instead of
the less appropriate number of items field (nitems).

Also, the db_check_table_nhash() function now checks the validity
of both nkeys and nitems fields.