pidl-python: cope with NULL pointers in more places