Avoid multiple close of ComPort.