Fix and optimize bitset index for case when key is empty

This patch fixes out of bounds memory access in bit_iterator_init
for size == 0. The patch also optimizes bitset/index library to skip
useless iterations over empty keys.

Closes #425