Revert upnp related patches and sync upnp to current master. Sync latest commits from 0.27.3-fixes.