mainloop: Deinit the dns thread cache when reverting the config

When reloading the configuration and the new config fails to initialize,
syslog-ng reverts to the old config. But by that time,
dns_cache_thread_init() has already been called (when trying to init the
new config), and dns_cache_thread_deinit() never got called. So when we
tried to cfg_init() the old config, it called dns_cache_thread_init()
again, and triggered an assertion.

Reported-by: Andras Mitzki <micek@balabit.hu>
Signed-off-by: Gergely Nagy <algernon@balabit.hu>