Fix: tools: Fix crm_mon seg fault when curses is missing
If Pacemaker is built without curses, crm_mon in console mode exits
immediately with a segmentation fault. There's no problem in one-shot
mode.
Early in main(), we fail to initialize the "console"-format
pcmk__output_t object. In clean_up(), we call out->finish() without
NULL-checking the output object.
We fix the issue as follows:
- Add a NULL-check for the output object
- Default to one-shot text mode if not CURSES_ENABLED. This was the original behavior, probably until 91112458.
- Consolidate that cases where we fall back from "console" to "text".
- Update the description (in build_arg_context()) to note that Pacemaker was built without curses, if appropriate.
Fixes CLBZ#5512
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>