Set F_SETNOSIGPIPE when MSG_NOSIGNAL is not available
Set F_SETNOSIGPIPE when MSG_NOSIGNAL is not available

Summary:
- iOS and OS X don't support MSG_NOSIGNAL. To prevent SIGPIPE from
poppig up, use fcntl(F_SETNOSIGPIPE) instead.

Test Plan:
- Ran on iOS simulator; used to abort on SIGPIPE
- Unit tests

Reviewed By: simpkins@fb.com

FB internal diff: D1286938


maxwell-demon/fbthrift,fengshao0907/fbthrift,jesboat/fbthrift,soumith/fbthrift,guker/fbthrift,maxwell-demon/fbthrift,HankFaan/fbthrift,maxwell-demon/fbthrift,maxwell-demon/fbthrift,HankFaan/fbthrift,fengshao0907/fbthrift,jesboat/fbthrift,getyourguide/fbthrift,LinusU/fbthrift,project-zerus/fbthrift,SergeyMakarenko/fbthrift,chjp2046/fbthrift,fengshao0907/fbthrift,kangkot/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,fengshao0907/fbthrift,project-zerus/fbthrift,soumith/fbthrift,facebook/fbthrift,HankFaan/fbthrift,fengshao0907/fbthrift,raphaelamorim/fbthrift,kangkot/fbthrift,kangkot/fbthrift,getyourguide/fbthrift,guker/fbthrift,raphaelamorim/fbthrift,maxwell-demon/fbthrift,HankFaan/fbthrift,chjp2046/fbthrift,guker/fbthrift,uber/fbthrift,guker/fbthrift,kangkot/fbthrift,project-zerus/fbthrift,uber/fbthrift,uber/fbthrift,fengshao0907/fbthrift,Orvid/fbthrift,facebook/fbthrift,raphaelamorim/fbthrift,raphaelamorim/fbthrift,sinjar666/fbthrift,raphaelamorim/fbthrift,kangkot/fbthrift,LinusU/fbthrift,sinjar666/fbthrift,jesboat/fbthrift,getyourguide/fbthrift,Orvid/fbthrift,sinjar666/fbthrift,guker/fbthrift,sinjar666/fbthrift,SergeyMakarenko/fbthrift,maxwell-demon/fbthrift,facebook/fbthrift,raphaelamorim/fbthrift,LinusU/fbthrift,guker/fbthrift,getyourguide/fbthrift,HankFaan/fbthrift,sinjar666/fbthrift,LinusU/fbthrift,facebook/fbthrift,soumith/fbthrift,getyourguide/fbthrift,soumith/fbthrift,Orvid/fbthrift,fengshao0907/fbthrift,maxwell-demon/fbthrift,sinjar666/fbthrift,HankFaan/fbthrift,kangkot/fbthrift,uber/fbthrift,maxwell-demon/fbthrift,Orvid/fbthrift,jesboat/fbthrift,sinjar666/fbthrift,fengshao0907/fbthrift,kangkot/fbthrift,getyourguide/fbthrift,LinusU/fbthrift,HankFaan/fbthrift,guker/fbthrift,facebook/fbthrift,project-zerus/fbthrift,LinusU/fbthrift,fengshao0907/fbthrift,chjp2046/fbthrift,sinjar666/fbthrift,jesboat/fbthrift,uber/fbthrift,soumith/fbthrift,soumith/fbthrift,soumith/fbthrift,maxwell-demon/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,guker/fbthrift,chjp2046/fbthrift,project-zerus/fbthrift,project-zerus/fbthrift,Orvid/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,chjp2046/fbthrift,kangkot/fbthrift,SergeyMakarenko/fbthrift,maxwell-demon/fbthrift,raphaelamorim/fbthrift,maxwell-demon/fbthrift,Orvid/fbthrift,jesboat/fbthrift,jesboat/fbthrift,jesboat/fbthrift,uber/fbthrift,raphaelamorim/fbthrift,SergeyMakarenko/fbthrift,soumith/fbthrift,project-zerus/fbthrift,getyourguide/fbthrift,jesboat/fbthrift,HankFaan/fbthrift,chjp2046/fbthrift,uber/fbthrift,project-zerus/fbthrift,sinjar666/fbthrift,guker/fbthrift,sinjar666/fbthrift,chjp2046/fbthrift,facebook/fbthrift,project-zerus/fbthrift,Orvid/fbthrift,Orvid/fbthrift,project-zerus/fbthrift,uber/fbthrift,jesboat/fbthrift,LinusU/fbthrift,soumith/fbthrift,facebook/fbthrift,LinusU/fbthrift,raphaelamorim/fbthrift,raphaelamorim/fbthrift,kangkot/fbthrift,chjp2046/fbthrift,guker/fbthrift,raphaelamorim/fbthrift,uber/fbthrift,getyourguide/fbthrift,kangkot/fbthrift,fengshao0907/fbthrift,HankFaan/fbthrift,chjp2046/fbthrift,getyourguide/fbthrift,jesboat/fbthrift,project-zerus/fbthrift,chjp2046/fbthrift,uber/fbthrift,uber/fbthrift,sinjar666/fbthrift,chjp2046/fbthrift,LinusU/fbthrift,soumith/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,uber/fbthrift,SergeyMakarenko/fbthrift,LinusU/fbthrift,kangkot/fbthrift,soumith/fbthrift,SergeyMakarenko/fbthrift,Orvid/fbthrift,Orvid/fbthrift,getyourguide/fbthrift,Orvid/fbthrift,HankFaan/fbthrift,LinusU/fbthrift,HankFaan/fbthrift,jesboat/fbthrift,fengshao0907/fbthrift,guker/fbthrift,chjp2046/fbthrift,SergeyMakarenko/fbthrift,project-zerus/fbthrift,SergeyMakarenko/fbthrift