Fix deadlock bug when reconnecting to printer
Use autoconf to detect pthreads.  Printer uses pthreads if available,
glib threads otherwise.