log_hook test: Fixed Linux and Windows problems

Linux problem: Using dash as a shell creates some trouble
(as e.g. on Travis CI).
Windows problem: Redirect of test hook was incorrect.

[ci skip]