mesa: fix glthread build issues on platforms without PTHREAD