mkclass should return exit code 1 when compilation fails.

Fixes #6292