If 1000 potential peers are known, wait for 5m before querying DNS seeds for more peers, since eventually the addresses we already know should get us connected. Also check every 11s whether we've got enough active outbounds that DNS seeds aren't worth querying, and exit the dnsseed thread early if so. DNS seeds: don't query DNS while network is inactive
Backport of core PR16939.