Improve capture_io handling of unexpected exceptions
Improve capture_io handling of unexpected exceptions

We frequently use `capture_io` in specs for testing running CLI
commands, many of which will indirectly end up calling `exit 1` in
failure conditions.

For a happy-path spec, if a regression breaks the spec, this is
problematic because `exit 1` gets called & `rspec` exits prematurely.
And, since stderr & stdout are being captured at the time of exit, you
don't see any message associated with the exit, and it's very
mysterious.

This add a rescue similar to `capture_io_and_exit_code` (which is
explicitly intended to test failure cases) to `capture_io` which will
fail the spec with an informative message if something does call `exit`.

codeclimate/codeclimate,codeclimate/codeclimate,codeclimate/codeclimate