Fix compile error on OS X

1. MSG_NOSIGNAL is not defined on OS X.
Use equivalent SO_NOSIGPIPE.
2. termios c_line element is not defined on OS X.
Skip c_line logdebug.
Add building instructions for OS X