Add talk_to_socket handler
This handler talks directly to a daemon using a Unix SOCK_SEQPACKET socket,
allowing e.g. cookie handlers to be implemented without having to fork and
and execute an external program or script interpreter.
A little explanation of the functioning of talk_to_socket():
1. We receive our argument as a string in the format of "HANDLER EXTRA_ARGS".
2. Copy "HANDLER" into our Unix socket address structure and connect to that
address (blocking). Error out if connection fails.
3. Write "EXTRA_ARGS" to the socket. Error out if writing fails.
4. Use poll() to wait for a response, timing out after 500ms of inactivity.
5. Use ioctl(FIONREAD) to find out how long the pending datagram is.
6. Allocate an appropriately sized buffer (len+1) and write a null at the
end, so our output is always null-terminated no matter what.
7. Read from socket into buffer. Error out if read fails.
8. Close socket.