flashing: Close serial port before showing message box