Issue #22042: Avoid dangerous C cast in socket.setblocking()

Avoid cast from (int*) to (u_long*), even if sizeof(int) == sizeof(u_long).
Issue #22053: Cleanup turtledemo start and stop and fix debug shutdown warning.
Merge with 3.4