Python keyboard interrupt while loop