test: fix compilation without thread support (EVENT__DISABLE_THREAD_SUPPORT=ON) (cherry picked from commit d0adbc05654eca27384b6496cfd8a22ed4dfb4fb)