Add `@nogc` attribute to `core.exception` functions.

The main change is `onOutOfMemoryError` & `onInvalidMemoryOperationError` are now `@nogc`.
fix Issue 13148 - ModuleInfo fields are unnecessary changed to const
Merge pull request #887 from denis-sh/add-`@nogc`-to-`core.exception`

Add `@nogc` attribute to `core.exception` functions.
Merge pull request #898 from 9rnsr/fix13148

[REG2.066a] Issue 13148 - ModuleInfo fields are unnecessary changed to const