gh-111178: fix UBSan failures in Modules/socketmodule.c
#128249
+154
−98
Merged