Support keyboard interrupt

This is needed at least on OS X.