Windows: Fix access violation that happens when the application is closed. It is caused by CBTProc() by reading deleted m_mapHwnd.