Make the mime_data functions python2.6 compatible

Replace PyCapsule with PyCObject