[9.18] Move the task creation into cache_create_db()
The dns_cache_flush() drops the old database and creates a new one, but it forgets to create the task(s) that runs the node pruning and cleaning the rbtdb when flushing it next time. This causes the cleaning to skip cleaning the parent nodes (with .down == NULL) leading to increased memory usage over time until the database is unable to keep up and just stays overmem all the time.
Also includes a backport of !8823 (merged)
Closes #4621 (closed)
See also #4596 (closed)
Edited by Michał Kępień