fix case_clause when HitId and DocId do not match when include_docs=true

Sometimes, a clouseau index may become out of sync with the db or
become corrupt under certain conditions (heap exhaustion, garbage collection).
This leads to certain HitIds that get returned which may not exist
in the current db. Before this fix, we assume the Hit's Id will
automatically match an Id return from:

fabric:all_docs(DbName, fun callback/2, [], [{keys, DocIds}, {include_docs, true}]).

When the document does not exist, {error, false} is returned for the row.
This fix  accounts for this scenario and possible other scenarios
by returning an error to the user and also logging the error when the
Hit Id does not match what is returned from the _all_docs call.
1 file changed