Work around windows multiprocessing bug

Set __opts__['test'] back to it's prior value at the end of the various
functions in salt.modules.state which use it.
Merge pull request #8171 from terminalmage/windows-opts-test-issue

Work around windows multiprocessing bug