Previously, the server would crash if it received a query with an ID
close to 65535 in the badmessageid case, as adding 50 to it would not
fit in uint16.
This was an oversight in porting it from Perl to Python in
f9ed3650acdc2c5b38d8b36729b045ca63f983ef.
Fixes #6025.
Merge branch 'stepan/fix-xfer-large-qid' into 'main'
See merge request isc-projects/bind9!12097