Added tests for hookCommand

This PR fixes a small bug on windows and adds more unit tests for the uniter.
and it'd be nice to get back an error in a predictable format: `"hooks/something-happened" does not exist` is I think superior, by virtue of being more predictable across platforms: it's a juju-level name for the executable, not an OS-level one. And it's easier to test -- really, .*s in error tests are dangerous because they risk allowing ugly error messages to leak up to the users.

And if we're generating ugly error messages, the least we can do is be explicit about what we're dumping on people and test it so we can tell when it changes. But it'd be better not to do so at all, and if you make a message change deep inside the codebase, you'll see test failures representing the actual impact on what users see. Helps keep us sane and honest, I think.