Free unused memory for threads and cancel any outstanding threads on interpreter exit to avoid possible segmentaiton fault.
This is to keep the top-level directory clean, to make it clear what is core and what is a port, and to allow the repository to grow with new ports in a sustainable way.