Return exit code

Fixes #439
now I am confused.. did not we do these checks to get the EmitResult.emitResultStatus? why redo it again here? the ones that are missing are syntactic and compiler options..