fix pthread free