Make shell handle ^C/^D gracefully

.. because it's often standard behaviour of shells to quit when ^C/^D is hit.

^C is caught by Interrupt, and ^D by StandardError.

Together with #110 this should also fix #92, I guess.