Improve error handling around 'git ls-tree' uses

In particular fix crash when /showtree is loaded with an invalid
argument.