#12 memleak fix + pthread dll attach routines, going to fix tctdb and ejdb...