Fix test using non-threadsafe list in multiple threads