pull: ref the thread default main context during init, unref in cleanup

...get_thread_default returns NULL when the thread default is also the global
default, so this only shows up when running in a thread (eg g_task_run_in_thread)