Conditionally compile os-specific bits of termios under Linux and OSX

Closes #2