Fix handling of TCGETS ioctl.

Resolves #360.