perf script: Fix Python support when no libtraceevent