libtextstyle: New function term_ostream_flush_to_current_style.
* gnulib-local/lib/term-ostream.oo.h (struct term_ostream): Add method
flush_to_current_style.
* gnulib-local/lib/term-ostream.oo.c (struct term_ostream): Add fields
default_attr, active_attr, non_default_active.
(out_attr_change): Remove second argument. Update active_attr.
(activate_non_default_attr, deactivate_non_default_attr, activate_default_attr):
New functions, extracted from output_buffer.
(output_buffer): Use them. Add a second argument.
(term_ostream::write_mem, term_ostream::flush): Update output_buffer calls.
(term_ostream::free): Add an assertion.
(term_ostream::flush_to_current_style): New method.
(term_ostream_create): Initialize the fields default_attr, active_attr,
non_default_active.
* libtextstyle/lib/textstyle.h (term_ostream_flush_to_current_style): New
declaration.
* libtextstyle/doc/libtextstyle.texi (The term_ostream class): Document
term_ostream_flush_to_current_style.
* libtextstyle/NEWS: Mention the change.