allow Kohana shutdown properly, exit(1) in case of exception
fix typo
some cleanup

no need to ensure if we're re-registering the shutdown function
more than once.
Merge pull request #460 from enov/bugfix/3931/exit-with-error-code/take2

Fixes #3931: allow Kohana shutdown properly, exit(1) in case of exception