Do terminal settings correctly for MacOS/BSD.
Do terminal settings correctly for MacOS/BSD.

Default settings for new serial devices seem to be different on BSD.  Let's
make sure to set CLOCAL (otherwise read/write might not work when there's no
carrier detect, even though many typical serial devices don't show a carrier
signal).  Also open in O_NONBLOCK mode in case the device is set to block
until a carrier is detected.

Both of these options are possible in Linux as well, so using the correct
values here should be right on all platforms.  We just got lucky on Linux.

apenwarr/port