Remove non-POSIX functions and be more tolerant with sethostname(3) prototype.

Remove getdomainname and setdomainname as they are not POSIX.

Some system implement sethostname(char *...) instead of const char *.
Since, a passing in const char * will cause an error on those platforms
and passing a char * will not cause an error on any platform, prefer the
latter.