Use "brew list <name>" instead of grepping the output of "brew list".

Some brew packages are not listed with their package name, e.g. libjpeg.
Merge pull request #5489 from daghoidahl/devel

Use "brew list <name>" instead of grepping the output of "brew list". Fix for #5488