Don't use dns_zone_attach() in zone_refreshkeys() [v9.18]
The zone_refreshkeys() could run before the zone_shutdown(), but after the last .erefs has been "detached" causing assertion failure when doing dns_zone_attach(). Remove the use of .erefs (dns_zone_attach/detach) and replace it with using the .irefs and additional checks whether the zone is exiting in the callbacks.
(cherry picked from commit 80e66fbd)
Closes #3643 (closed)
Edited by Ondřej Surý