[bugfix] resetState was only called once on user defined functions. It should be called whenever a query is returned to the pool. Not doing so results in extended memory use and potentially wrong query results if the cached query is reused.