Fix handling of TCGETS ioctl.