Exit with escript exit codes instead of always exiting with 0.

Allows escript to return non-zero exit codes for error handling, etc. Alternatively, instead of exiting from within the case statement, we could use a return variable that could be set from any statement, and use that at the end instead of 'exit 0'.