[bugfix] Fix memory leak in lucene-based query functions

preselectResult needs to be cleared in resetState.