upnp: force -lpthread (fixes #24239)

The pkg-config file correctly supplies -pthread for LDFLAGS, but
libtool discards it, leading to linkage failure if libupnp is linked
statically.
20 jobs for master in 51 minutes and 46 seconds (queued for 15 seconds)