Python: Use new PyCapsule API where supported.