Fix for gridfs and creation of indexes

get_gridfs tries incorrectly to find count of indexes, and tries always to recreate them. Thus making using slave impossible.