* libio/Makefile (tests): Add bug-ungetwc2. * libio/bug-ungetwc2.c: New file.
* libio/bug-ungetwc1.c: New file. * libio/Makefile (tests): Add bug-ungetwc1. * libio/fileops.c (_IO_new_file_close_it): Only call _IO_do_flush if stream was last used for writing.