fix emerge thread double free and sky mem leak