Check return values from fcntl and setsockopt
These functions are allowed to fail, though in practice they won't (at least, not the way we're using them). Still, our failure to check the return values makes some tools (Coverity scan) unhappy. Let's clean up false positives by checking our 12 unchecked fcntls and our one unchecked setsockopt.