python catch keyboardinterrupt signal