[PATCH 4.19 090/346] serial_core: Check for port state when tty is in error state