Try to use fchmod() first when changing permissions on an AF_UNIX socket
In connection_listener_new() of connection.c, we need to change permissions of an AF_UNIX socket in one case, and on some platforms it doesn't work to use fchmod(), or so a comment claims. It'd be better to avoid the race condition by using fchmod() when possible though.
We should move this to a unix_socket_chmod() function in compat.c, perhaps, which should take a file handle, a path and a mode, and try fchmod() and then fall back to chmod() if it fails.
Point of clarification: if fchmod() fails, will it fail by returning a sensible error code or by silently not modifying the permissions? Should unix_socket_chmod() also fdstat() as needed to check that the mode is correct?