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