Redirect stderr from which

This avoids `which: no fetch in ($PATH)` messages when downloading dependencies. These can get pretty long.
Add quotes and an informative error message

Since [ -x  ] is true, but [ -x "" ] is false
Merge pull request #5972 from tkelman/patch-1

Redirect stderr from which