ftplib tests: provide a global socket's TIMEOUT variable and use it everywhere so that failing tests won't accidentally hang
Issue #17992: Add timeouts to asyncore and asynchat tests so that they won't accidentally hang.
Add Nick Sloan for his contribution to #17732
Merge with 3.3
rather than passing locals to the class body, just execute the class body in the proper environment
fix compilation on Windows
Issue #17964: Fix os.sysconf(): the return type of the C sysconf() function
is long, not int.
C89 declaration compliance
merge 3.3
make GCC complain about declarations not at the top of blocks
Issue #17981: Closed socket on error in SysLogHandler.
Closes #17981: Merged fix from 3.3.
Fix a compilater warning on Windows 64-bit

idx variable is used for a tuple indexn so use Py_ssize_t (not int).
Fix a compilater warning on Windows 64-bit
Fix compilater warnings on Windows 64-bit