phantomjs: build from source.

Closes #22446
phantomjs: add bottles.
bottle: loosen prefix grep check.

/usr/local is in lots of things unrelated to Homebrew so be more specific and look for opt instead.
cmake, jpeg, mpfr: add missing cellar :any.
erlang: install manpages only in lib/erlang/man

Erlang man pages have generic names that can conflict with other
packages. Since they are usually placed in lib/erlang/man and accessed
via "erl -man", let's keep them out of share/man.

Users can add $(brew --prefix erlang)/lib/erlang/man to $MANPATH if they
want to use man to find them.