Migrate to struct termios and tc{get,set}attr()
This patch fixes compilation errors on systems with recent glibc.
The struct termio has been removed from glibc (see the related patch).
Related: https://sourceware.org/git/?p=glibc.git;a=commit;h=e04afb71771710cdc6025fe95908f5f17de7b72d