Only run the query once to update whoosh index

Currently, the len(iterable) will cause a second query to be issued to
the database. If you're using a generator, this will fail. For regular
querysets, it's running a second query needlessly.