update osx build.sh
Only build abstract socket code on linux
osx: lots of misc build fixes
Allow running simulator in thread on OSX