Reordered manager cleanup so threads are killed before their resources.