fix #800

I'll let Jenkins run test suite on Linux and I'm manually running test suite on my Windows laptop. It's very slow so it'll probably take several hours.

In the meantime I need reviews. It turns out that the problem is really about string escaping. Based on the observation that I'm using the same shell on both Linux and Windows(bash) but still having different results(on Linux it works OK, on Windows it fails as shown in #800), I assumed that it's only related with the platform and not the shell. So I treated Windows as a special case in `getXYZCmd()` methods.

I also assumed that the test suite is running fine on OSX so special case is really Windows and not Linux.