python check if serial port is open