[9.18] Resolve "ThreadSanitizer: data race lib/dns/rbtdb.c:1365 in newversion"

Arаm Sаrgsyаn requested to merge 3907-data-race-in-rbtdb-v9_18 into v9_18

Backport of !7637 (merged).

Closes #3907 (closed)

Merge request reports