restore serial port settings on exit