Bug fixes and afc2 access in cython bindings

Per request, broke up the prior commit into individual commits.  Please see the commit messages for specifics on each change.  These changes fix some compile errors and segfaults I encountered on Mac OS X and adds functionality to support Afc2 filesystem access.