netbsd support

rebased version of https://github.com/antirez/redis/pull/735