Update net.cpp

Correction of errors compiling on Linux with UPNP defines enabled.