server: check listen(2) return value
server: check listen(2) return value

The `listen` call can fail with EADDRINUSE after bind() succeeds, for
example because another process called listen on that port in the
meantime, or under some circumstances with IPv6-mapped-IPv4. This was
causing EINVAL on accept, with an infinite loop in case of libuv.

A reproducible example was to run nc -l -p 5555 ( OpenBSD netcat (Debian
patchlevel 1)) before starting test-server

Signed-off-by: Denis Osvald <e00731e7c3a13144c708ef6111353042fb69a38e@sartura.hr>

sartura/libwebsockets,sartura/libwebsockets,sartura/libwebsockets,sartura/libwebsockets,sartura/libwebsockets,sartura/libwebsockets,sartura/libwebsockets