blob: fixed sanity check

Even if b == NULL sanity check succeeded we still can SEGFAULT in
b->cfg dereference in log message.
blob: fixed possible zero-size allocs
blob: propagate internal iterator errors to caller

This fixes silient data corruption in case of iteration over a malformed
index.
Now iterator return code reflects internal iterator errors so that
detect that index has broken entries on data-sort and in elliptics
recovery.

Reported by: shaitan@
data-sort: remove redundant code

Now iterator is propagating errors, so this code is not needed.
blob: move reord check routines to separate function

So we can easily plug item checks in any code path.
index: check index validity on start
blob: be less strict about index corruptions
blob: fix eblob_total_elements()

Now return (`total` - `removed`) instead of just `total`
index: set pointers to NULL in eblob_index_blocks_destroy()
index: fix possible stat race
stress: check second's eblob_init() result
mobjects: fix eblob_index_blocks_fill()'s rc check
index: explicitly return 0 on success
mobjects: make sorted index mandatory if it exists.

First check index with access(2) and if it exists then
eblob_base_open_sorted() must succeed else we should not even try.
stats: add counter for corrupted index entries
index: changed doc link to knowledge base article
Merge pull request #33 from SaveTheRbtz/master

Bugfixes: handling of malformed databases, iterators and indexes