[python] keeping references to native object to avoid GC of callbacks