test_astobj2_thrash: Fix multithreaded issues