Start fixing issues #42 and hopefully #31.

For now, I have fixed #42 (except it doesn't yet work with `set_trace()`).  To
fix #31, I need to figure out what the best signal to use is.

@inducer, can you please verify that I've put this in the best place in the
code? As far as I can tell, `set_trace()` follows a completely different code
path, so it will require a separate handler.  I tried to put it in the part of
the code that the comments said was for setup just before the debugger starts,
so it should hopefully minimize bizarre things happening if someone press
Control-C before the debugger actually starts up.