tests: fix data race in test for ReadAndWatchConfigFile