Fix obsolete flags in the ctypes bindings, and add some debugging notes.

This is the result of debugging a segfault that appeared when using the Python bindings.  Problem appears to be localized to old ctypes declarations that don't match the released headers, and fixing them seems to have made my occasional segfaults (about 1 every 100,000 pages) go away.