gegl: close the swap writer thread and file handles when exiting