cmd/search: mark installed formulae
cmd/search: mark installed formulae

`brew search emacs`, with homebrew/emacs tapped:
```
real    0m2.586s
user    0m1.138s
sys     0m0.121s
```
Previously:
```
real    0m2.831s
user    0m1.385s
sys     0m0.087s
```

`brew search s`:
```
real    0m2.260s
user    0m1.201s
sys     0m0.114s
```

Previously:
```
real    0m5.953s
user    0m4.827s
sys     0m0.226s
```

Closes Homebrew/homebrew#35696.
Closes Homebrew/homebrew#42662.

pseudocody/brew,amar-laksh/brew_sudo,reitermarkus/brew,DomT4/brew,pseudocody/brew,staticfloat/brew,reelsense/brew,konqui/brew,MikeMcQuaid/brew,amar-laksh/brew_sudo,Homebrew/brew,AnastasiaSulyagina/brew,reelsense/brew,claui/brew,jmsundar/brew,mgrimes/brew,claui/brew,mahori/brew,sjackman/homebrew,ilovezfs/brew,mistydemeo/homebrew,nandub/brew,bfontaine/brew,zmwangx/brew,AnastasiaSulyagina/brew,Linuxbrew/brew,gregory-nisbet/brew,nandub/brew,muellermartin/dist,reelsense/brew,nandub/brew,gordonmcshane/homebrew,Linuxbrew/brew,JCount/brew,toonetown/homebrew,muellermartin/dist,rwhogg/brew,mahori/brew,aw1621107/brew,maxim-belkin/brew,konqui/brew,EricFromCanada/brew,gordonmcshane/homebrew,gregory-nisbet/brew,maxim-belkin/brew,staticfloat/brew,toonetown/homebrew,Homebrew/brew,Linuxbrew/brew,sjackman/homebrew,reitermarkus/brew,Linuxbrew/brew,reitermarkus/brew,EricFromCanada/brew,aw1621107/brew,bfontaine/brew,JCount/brew,pseudocody/brew,mahori/brew,MikeMcQuaid/brew,jmsundar/brew,alyssais/brew,sjackman/homebrew,vitorgalvao/brew,Homebrew/brew,Homebrew/brew,palxex/brew,mahori/brew,JCount/brew,MikeMcQuaid/brew,alyssais/brew,zmwangx/brew,toonetown/homebrew,mgrimes/brew,rwhogg/brew,JCount/brew,ilovezfs/brew,hanxue/linuxbrew,staticfloat/brew,DomT4/brew,DomT4/brew,vitorgalvao/brew,mgrimes/brew,amar-laksh/brew_sudo,ilovezfs/brew,EricFromCanada/brew,claui/brew,konqui/brew,palxex/brew,gordonmcshane/homebrew,DomT4/brew,vitorgalvao/brew,EricFromCanada/brew,AnastasiaSulyagina/brew,maxim-belkin/brew,alyssais/brew,hanxue/linuxbrew,tonyg/homebrew,muellermartin/dist,gregory-nisbet/brew,mistydemeo/homebrew,konqui/brew,jmsundar/brew,aw1621107/brew,claui/brew,mistydemeo/homebrew,tonyg/homebrew,MikeMcQuaid/brew,hanxue/linuxbrew,nandub/brew,zmwangx/brew,bfontaine/brew,vitorgalvao/brew,sjackman/homebrew,tonyg/homebrew,palxex/brew,reitermarkus/brew,rwhogg/brew