use correct os detection for windows in cli (fixes #1645)