MFH: r503379
Fix a possible race between udp dispatch and socket code.
PR: 237640 Obtained from: https://gitlab.isc.org/isc-projects/bind9/merge_requests/1992