gsocket: move set_fd_nonblocking() into g_socket_constructed()
gsocket: Set SO_NOSIGPIPE on sockets on Darwin

This is a best-effort approach to preventing SIGPIPE emissions on Darwin
and iOS, where they continue to be intercepted by the Xcode debugger
even if SIG_IGN prevents them crashing the program.

This is similar to the existing code which sets MSG_NOSIGNAL on all
send() calls. MSG_NOSIGNAL doesn't exist on Darwin though.

Based on a patch from Philip Withnall.

https://bugzilla.gnome.org/show_bug.cgi?id=728730
gio/tests/socket: add some missing g_assert_no_error()s