[PATCH v2 OLK-5.10 28/40] serial_core: Check for port state when tty is in error state