Exit with a corresponding code.