Replace hand-made linked list of ui_out_hdr by vector and iterator
Instead of keeping pointers to first, last and current ui_out_hdr in
ui_out_table, we can use an std::vector and an iterator. Direct random
access of to vector helps make get_next_header a bit nicer by avoiding
iterating on all the headers. append_header_to_list is also a bit
simpler.
Also, using unique_ptr inside the vector allows expressing the ownership
of the ui_out_hdr objects by the ui_out_table object, and it simplifies
the destruction.
gdb/ChangeLog:
* ui-out.c (struct ui_out_hdr) <next>: Remove.
(struct ui_out_table) <header_first, header_last, header_next>: Remove.
<headers, headers_iterator>: New fields.
(ui_out_table_body): Update for the new data structure.
(ui_out_begin): Likewise.
(clear_header_list): Likewise.
(append_header_to_list): Likewise.
(get_next_header): Likewise.
(ui_out_query_field): Likewise.
(ui_out_new): Likewise.