Reimplement dns_dumpctx_db and dns_dumpctx_version to prevent issues in #134
dns_dumpctx_db and dns_dumpctx_version pass a pointer rather then attaching to the relevant structures which can result in use after ref count goes to zero.
If we don't want to change the prototype we can just state that these need to be detached and do a dummy attach. Changing the prototype would however ensure that code using these is updated.