tap: cache dir path to avoid duplicated Pathname operations
tap: cache dir path to avoid duplicated Pathname operations

As discovered in #50256, this becomes a performance bottleneck as we are
repeating construct same Pathname object.

At the same, this commit makes the behaviors between Tap and CoreTap more
consistence.

lrascao/homebrew,marcwebbie/homebrew,elgertam/homebrew,frodeaa/homebrew,ExtremeMan/homebrew,Angeldude/linuxbrew,Linuxbrew/linuxbrew,gawbul/homebrew,benjaminfrank/homebrew,joshfriend/homebrew,influxdb/homebrew,totalvoidness/homebrew,frodeaa/homebrew,josa42/homebrew,tutumcloud/homebrew,cscetbon/homebrew,AlexejK/homebrew,sakra/homebrew,influxdb/homebrew,dplarson/homebrew,theeternalsw0rd/homebrew,brunchboy/homebrew,gawbul/homebrew,emcrisostomo/homebrew,dericed/homebrew,scorphus/homebrew,emcrisostomo/homebrew,saketkc/linuxbrew,Homebrew/linuxbrew,SuperNEMO-DBD/cadfaelbrew,liamstask/homebrew,reelsense/homebrew,scorphus/homebrew,skinny-framework/homebrew,filcab/homebrew,pcottle/homebrew,benjaminfrank/homebrew,nandub/homebrew,filcab/homebrew,skinny-framework/homebrew,mkrapp/homebrew,totalvoidness/homebrew,totalvoidness/homebrew,ablyler/homebrew,reelsense/homebrew,influxdata/homebrew,mkrapp/homebrew,deorth/homebrew,marcwebbie/homebrew,reelsense/linuxbrew,reelsense/linuxbrew,ilovezfs/homebrew,filcab/homebrew,tutumcloud/homebrew,skinny-framework/homebrew,optikfluffel/homebrew,ablyler/homebrew,BrewTestBot/homebrew,yumitsu/homebrew,georgschoelly/homebrew,ablyler/homebrew,scorphus/homebrew,reelsense/homebrew,sakra/homebrew,skinny-framework/homebrew,base10/homebrew,sjackman/linuxbrew,OJFord/homebrew,tschoonj/homebrew,dericed/homebrew,Asuranceturix/homebrew,georgschoelly/homebrew,SuperNEMO-DBD/cadfaelbrew,lrascao/homebrew,pcottle/homebrew,Homebrew/linuxbrew,afh/homebrew,afh/homebrew,Angeldude/linuxbrew,brunchboy/homebrew,muellermartin/homebrew,reelsense/homebrew,OJFord/homebrew,georgschoelly/homebrew,joshfriend/homebrew,sferik/homebrew,Homebrew/linuxbrew,pcottle/homebrew,Homebrew/homebrew,yumitsu/homebrew,muellermartin/homebrew,base10/homebrew,3van/homebrew,gnubila-france/linuxbrew,Homebrew/homebrew,elgertam/homebrew,muellermartin/homebrew,dutchcoders/homebrew,Linuxbrew/linuxbrew,michaKFromParis/homebrew-sparks,joshfriend/homebrew,liamstask/homebrew,SuperNEMO-DBD/cadfaelbrew,cscetbon/homebrew,theeternalsw0rd/homebrew,reelsense/linuxbrew,getgauge/homebrew,getgauge/homebrew,AlexejK/homebrew,3van/homebrew,pcottle/homebrew,saketkc/linuxbrew,chadcatlett/homebrew,benjaminfrank/homebrew,benjaminfrank/homebrew,influxdata/homebrew,Asuranceturix/homebrew,saketkc/linuxbrew,gnubila-france/linuxbrew,influxdata/homebrew,dplarson/homebrew,booi/homebrew,sjackman/linuxbrew,pcottle/homebrew,sakra/homebrew,deorth/homebrew,base10/homebrew,optikfluffel/homebrew,dplarson/homebrew,michaKFromParis/homebrew-sparks,theeternalsw0rd/homebrew,sakra/homebrew,Linuxbrew/linuxbrew,michaKFromParis/homebrew-sparks,Asuranceturix/homebrew,sjackman/linuxbrew,deorth/homebrew,afh/homebrew,BrewTestBot/homebrew,Asuranceturix/homebrew,sferik/homebrew,BrewTestBot/homebrew,elgertam/homebrew,liamstask/homebrew,ilovezfs/homebrew,optikfluffel/homebrew,marcwebbie/homebrew,Angeldude/linuxbrew,tschoonj/homebrew,nandub/homebrew,Angeldude/linuxbrew,AlexejK/homebrew,base10/homebrew,liamstask/homebrew,getgauge/homebrew,Homebrew/homebrew,frodeaa/homebrew,mkrapp/homebrew,Homebrew/linuxbrew,optikfluffel/homebrew,3van/homebrew,georgschoelly/homebrew,OJFord/homebrew,sferik/homebrew,dplarson/homebrew,totalvoidness/homebrew,getgauge/homebrew,brunchboy/homebrew,Homebrew/homebrew,ilovezfs/homebrew,nandub/homebrew,dutchcoders/homebrew,Linuxbrew/linuxbrew,chadcatlett/homebrew,theeternalsw0rd/homebrew,ralic/homebrew,ablyler/homebrew,emcrisostomo/homebrew,3van/homebrew,tschoonj/homebrew,influxdata/homebrew,muellermartin/homebrew,nandub/homebrew,josa42/homebrew,josa42/homebrew,elgertam/homebrew,yumitsu/homebrew,ralic/homebrew,BrewTestBot/homebrew,influxdb/homebrew,sjackman/linuxbrew,afh/homebrew,gnubila-france/linuxbrew,AlexejK/homebrew,chadcatlett/homebrew,dericed/homebrew,Asuranceturix/homebrew,ExtremeMan/homebrew,influxdb/homebrew,tutumcloud/homebrew,booi/homebrew,scorphus/homebrew,ralic/homebrew,ralic/homebrew,booi/homebrew,dutchcoders/homebrew,cscetbon/homebrew,marcwebbie/homebrew,saketkc/linuxbrew,brunchboy/homebrew,tschoonj/homebrew,gnubila-france/linuxbrew,OJFord/homebrew,filcab/homebrew,dutchcoders/homebrew,SuperNEMO-DBD/cadfaelbrew,gawbul/homebrew,sferik/homebrew,ExtremeMan/homebrew,dericed/homebrew,frodeaa/homebrew,lrascao/homebrew,reelsense/linuxbrew,ExtremeMan/homebrew,emcrisostomo/homebrew,tutumcloud/homebrew,ilovezfs/homebrew