Fixes #3931: allows Kohana to shutdown properly and exit(1) in case of an exception