CursesDialog: reduce manual memory management
- Replace owning raw pointers with
std::unique_ptr
. - Use
std::string
/std::vector
instead of dynamic allocated array. - Reorder some lines in
cmCursesCacheEntryComposite.cxx
to avoid thestatic_cast
expressions.