emacsclient: prefer XDG_RUNTIME_DIR (Bug#33367)

* lib-src/emacsclient.c: Disable -Wformat-truncation=2,
to avoid false alarms about the new snprintf calls.
(local_sockname): New function.
(set_local_socket): Use it.  Prefer XDG_RUNTIME_DIR (if set)
for location of socket directory.  Avoid unnecessary memory
allocation by using snprintf to destination.
* lisp/server.el (server-socket-dir): Prefer XDG_RUNTIME_DIR if set.
1 job for master in 21 minutes and 7 seconds (queued for 2 seconds)
Status Job ID Name Coverage
  Test
failed #192
test

00:21:07

 
Name Stage Failure
failed
test Test
make[2]: *** [check-doit] Error 1
Makefile:301: recipe for target 'check-doit' failed
make[2]: Leaving directory '/builds/tzz/emacs/test'
make[1]: *** [check] Error 2
Makefile:271: recipe for target 'check' failed
make[1]: Leaving directory '/builds/tzz/emacs/test'
Makefile:955: recipe for target 'check' failed
make: *** [check] Error 2
ERROR: Job failed: exit code 1