Validate that by_node and by_range are consistent

This introduces a validate_doc_update to the internal 'dbs' db. It
currently only verifies that by_node and by_range are internally consistent.

BugzID: 16431