race condition with thread access to m_fd