[9.18] Resolve "Assertion failure in dns__catz_update_cb() on shutdown"

Backport of !8409 (merged).

Closes #4381 (closed)

Merge request reports