Populate TERRAIN_WINDOW_TERM_WIDTH variable in curses mode.

Fixes the terrain editing debug menu in curses mode, which was broken by #6023.