Fix bug under Linux where STDIN would not be returned to normal