dri2: use pthread types instead of C11 threads ones.
There is no guarantee that cnd_t corresponds directly to pthread_cond_t, which is what egl_dri2.c assumes, given that it uses pthread_cond_* functions for manipulating this variable. Same goes for mtx_t and pthread_mutex_t.
PTHREAD_*_INITIALIZERs aren't necessarily 0, so initializing dri2_sync requires more than just a calloc call.
Also destroy the pthread_condattr_t attr variable used to initialize the cond variable when it stops being used (arguably a resource leak, depending on implementation details).