Openbsd build fixes

various commits to let git master compile on OpenBSD, last commit fixes issue #777.

The tcpconns.c change style is probably to be discussed, i wasnt sure how to make the #ifdef readable - it's a patch we've been carrying since a year or so in http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/sysutils/collectd/patches/patch-src_tcpconns_c?rev=1.1&content-type=text/x-cvsweb-markup

Adding -lpthread to collectd-tg LDADD is probably harmless.