poller.c: make sure that the socket is valid

Because we use long long to pass sockets from/to python, the
domain of the input socket is larger than the domain of an
actual socket; therefore, make sure that the input socket is
also valid in the domain of an actual socket.
Makefile.in: compile in debug mode