Add threading support for glib older than 2.32. Remove AM_DETECT_PTHREADS from configure.ac: glib is now default threading implementation. Include windows.h before using sleep in thread.h