Revert "made sure query_free() can be processed even no get_sel was called"

This reverts commit acb206dbeb0c662467de88d3e9c37f2d2032db10.

The reverted commit produces a regression on an earlier bug that was fixed.
Whatever this commit was attempting to fix, it appears to be the wrong
way to do it, and it is causing other errors, so it as been reverted.