Make sure g_thread_pool_stop_unused_threads() actually stops unused

* glib/gthreadpool.c: Make sure
g_thread_pool_stop_unused_threads() actually stops unused threads
and global limits (like max idle time and max unused threads) can
be set without creating a thread pool first. Fixed #335215 (patch
from Chris Wilson).

* tests/threadpool-test.c: Added two new tests, tests setting
global limits before creating a thread pool. The second test
makes sure unused threads are actually stopped when using the
g_thread_pool_stop_unused_threads().
6 files changed