Add exit code parameter so that we can exit correctly if something goes wrong.

Refer to https://github.com/learnmath/lysa/pull/17#issuecomment-67956751 for more details.