unix: fixed build on freebsd

Building on FreeBSD 10 (with clang), the RTF_WASCLONED constant was removed in FreeBSD 8, also complained about malloc and stuff being undefined. Not sure if this is the best solution but at least it builds.