Finishes porting _threading module, untested