pidl/python: support HRESULT errors in generated python bindings.