Additionally also initialize namespace lock only once per test run, there is no reason to initialize it multiple times to avoid races. Fixes #2137
Fixes #1821