fix invalid use of iterator in inverted_index_storage (fix #498)