Issue #27330: Fixed possible leaks in the ctypes module.