Close serialport after control signals sent