[tor-commits] [tor/master] Extract shared parts of portcfg_get_first_advertised_*()