Fix fd and minor memory leak in threadengine_pthread on unload of m_mysql