Alternative clean exit from log commands. Fixes #104.

I read the documentation on the Interrupt exception and it said that it was normally rescued using Signal.trap, so I rewrote using trap instead.

Please compare to #105 and merge the best.