[netcore] Require use of MonoClass getters in Debug builds (mono/mono#18267)
1. Update `build.sh` to use `--enable-checked-build=private_types` which forces the use of getter methods to access `MonoClass` fields.
2. Fix up some places that were accessing MonoClass directly.
3. Get rid of a spurious comma operator usage from an earlier refactoring:
```c
z = a, b, c;
```
is the same as
```c
z = a; b; c;
```
which is the same as just `z = a;` if `b` and `c` have no side-effects.
Commit migrated from https://github.com/mono/mono/commit/
6abab691ec71c3cb4f72dd6d8f630088c8330357