Fix tests on Windows by setting environment variable internally. Fixes #209.