Close the serial port when the application closes.