Ensure that cursesmutex is locked for mainwindow erase