gh-111178: fix UBSan failures in Modules/_multiprocessing/semaphore.c
#129084
+5
−2
Modules/_multiprocessing/semaphore.c
#129084