Fixes a threading issue where the curses logging tool did not respect other curses operations; it now properly locks the mutex before attempting to write data to the window