ocperf: use perf name attribute to map back names

Use the (undocumented) perf name= event attribute to map
back event names to their true name. This finally allows mapping
back in perf report gtk / ui mode, and replaces the old hack
of mapping back through a pipe.

Only works for 3.4+

One drawback is that attributes are not added to the name, so if you
have multiple events with the same name but different attributes
it will not be unique.
Also dots are not allowed, so we replace them all with underscore.

Also replace some os.system with subprocess

And fix a bug with new style event output losing cmasks.