Refactoring of test_windows.py

Adds missing @mock.patch decorators for winreg and other modules.