tests: fix shm test deadlock