Fix Windows test exclusions

Closes gh-4243

While testing, I also spotted a problem with an check in one of our decorators, which appears on Windows systems with Python 3 but without pywin32.