more termios functions moving to common code out of util