[Coop] Convert performance counters and performance counter categories. (#13623)
* Cut down on strlen calls.
But keep the shared memory format unchanged to match .NET. (i.e. don't
put string lengths in it).
* PR: MONO_ENTER_NO_SAFEPOINTS instead of gchandle.
Push/pop frames in loops and mind the return/goto/break/continue carefully, instead of using assignment.
*PR: Reduce gsize to adequate int, move multiple int declarations to same line.
* PR: Fix prototypes in disabled code.
* PR: Spell out `int` as `gint32`.
Use an uppercase guid to workaround Windows problem.
* A bit more true to the previous version.
* Reduce diff a little.
* if (is_ok()) around one line instead of goto around it.
* Restore some old code.
* Restore more verbosity, that used to have a point but no longer does.