[PATCH 4.14 059/242] serial_core: Check for port state when tty is in error state