POSIX requires that the buffer used by getdelim/getline add a
terminating NUL whenever an EOF is read.
* libio/iogetdelim.c (__getdelim): Add a NUL byte when the first
__underflow is called.
* libio/tst-getdelim.c (do_test): Add a test case for the bug.
Reviewed-by: Florian Weimer <fweimer@redhat.com>