HPCC-12282 Move roxie global stats into new mechanism

Various issues found when testing:
1. Correct destruction order of activities versus indirect scopes, to prevent
intermittent core from CActivity destructor.
2. Fixed core in library1.ecl test, related to name changes (HPCC-12403)
3. Fixed assert error updating workunit stats

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>