The start_udp() function didn't properly attach to the query and thus a callback with ISC_R_CANCELED would end with wrong accounting on the query object. Usually, this doesn't happen because underlying libuv API uv_udp_connect() is synchronous, but isc_nm_udpconnect() could return ISC_R_CANCELED in case it's called while the netmgr is shutting down.