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.
Merge branch 'trap-log-exit'