`PyScopeTest.TestThread` does not properly synchronize access to `res` and `th_cnt` variables. A lock needs to be added to ensure update calls are serialized. We should increase the number of threads to make the issue stand out if regressed. For more details see https://github.com/pythonnet/pythonnet/pull/1022#discussion_r385022598