Breakout tty code that is linux specific into appropriate file building.
Add osx specific tty detection.

Since TCGETS doesn't exist on this unix variant, use tcgetattr instead.
Less derp while parsing ubuntu release version information.