CMake: rework symbol checking to work with -Werror
CMake: rework symbol checking to work with -Werror

Rework checking for existence of getaddrinfo, socket, poll and select so
that it works when -DCMAKE_C_FLAGS="-Werror" is passed to CMake.

Haster2004/rabbitmq-c,alanxz/rabbitmq-c,alanxz/rabbitmq-c,alanxz/rabbitmq-c,Haster2004/rabbitmq-c,Haster2004/rabbitmq-c