add #ifdef around UPnP setting things to fix build with --disable-upnp
Merge pull request #2409 from herrnst/pr-fixdisableupnp

add #ifdef around UPnP setting things to fix build with --disable-upnp