Fix undefined behaviour triggered by test suite
for_each_helper and wl_socket_init_for_display_name both have undefined behaviour on some inputs
Notably this was not picked up by !139 (merged) turning on ubsan and asan, probably because the CI container is using gcc while I am using clang. Neither of these issues were picked up by gcc 10.
With this the test suite is ubsan-clean with clang 11. You can check this by doing:
CC=clang CXX=clang++ meson -Db_sanitize=undefined -Db_lundef=false -Dc_args=-fno-sanitize-recover=undefined build
cd build
ninja test
on a system with clang 11 installed