Delete libraries which registered a SQL query to build it before running
the query. The query is supposed to re-build it from scratch anyway.
Otherwise stale entries are not removed.