pidl: Fix our python reference handling