calling exit(), the IoErr() value set at this time will now be
preserved until the program really returns control to the shell.
This turned out to be easier to implement than I had originally
thought, thanks to the fact that the atexit() functions are all
invoked straight after the exit() call.