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

The main change is `onOutOfMemoryError` & `onInvalidMemoryOperationError` are now `@nogc`.
Merge pull request #887 from denis-sh/add-`@nogc`-to-`core.exception`

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