ccmake: Fix crash when resizing the window during configure
This is required to properly handle window resize as a signal (SIGWINCH) Since signals can interrupt code at any point, protecting and synchronizing the screen modifications is required.
This is currently only used to protect the current log display during configure which is the most probable data race occurence. This should probably be done for all screen modification, but doing that correctly and properly may require a consequent refactoring.
Fixes: #20093