test_poll: avoid potentially thread-unsafe test