fix sphinx_build memory leak bug, caused by mongo_cursor