Only perform backquote substitution when needed

Spawning shells is an expensive operation.
In a lot of cases, there is no need for any substitution.
Besides, this does not work on Windows.
Remove trailing spaces in rospack.cpp