Added SIGINT handler to the diagnostic Python program so that the serial port would be properly closed when using Ctrl-C to quit.