Demonstrate circumstances where we may miss indexing documents

If a document is added before ensureIndexed is called to an index
that was created in a previous session, the document is not correctly
indexed during the ensureIndexed call.

This is the case even if the user calls updateIndexes after
calling ensureIndexed.
Fix sequenceNumber property on TD_Database
Make sure updateIndexes uses only correctly registered indexes

Previously, if an index had been registered in a previous session,
the index manager would try to update it even though an indexing
function hadn't yet been registered this session. This would result
in indexing nil values for any documents updated or added during
the period between the index manager being created and ensureIndexed
being called, but the index thinking it had successfully updated
itself.

This fixes FB31844.