Add CloseHook support. This fixes the problem for the search component, but not for the query parser plugin. Part of CONNECTORS-333.