Fix threading support in X11.