[PATCH 5.4 067/453] serial_core: Check for port state when tty is in error state