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