Minor portability fixes

 * Include netinet/in.h
 * Instead of clearenv(), use unsetenv()