giochannel: Fix read_line() when nul is not a line terminator

And add a test for it.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Fixes: #2002
13 jobs for 2002-g-io-channel-read-line-nuls in 16 minutes and 47 seconds (queued for 1 second)
Status Job ID Name Coverage
  Style Check
failed #555040
allowed to fail
style-check-diff

00:02:17

 
  Build
passed #555045
cross-android_api21_arm64

00:05:23

passed #555046
cross-android_api28_arm64

00:02:13

passed #555047
cross-mingw64

00:05:20

passed #555042
debian-stable-x86_64

00:03:11

failed #555041
fedora-x86_64

00:04:49

failed #555044
G_DISABLE_ASSERT

00:02:52

passed #555043
installed-tests

00:14:30

passed #555048
win32
msys2-mingw32

00:11:13

failed #555049
win32
vs2017-x64

00:02:04

 
  Coverage
skipped #555050
coverage
 
  Analysis
skipped #555052
scan-build
skipped #555051
allowed to fail
valgrind
 
Name Stage Failure
failed
fedora-x86_64 Build
_build/glib/glibconfig.h: found 1 matching files   
_build/meson-logs: found 4 matching files

_build/fedora-x86_64-report.xml: found 1 matching files

_coverage: found 2 matching files

Uploading artifacts to coordinator... ok
id=555041 responseStatus=201 Created token=EALyV-jV
Uploading artifacts...
_build/fedora-x86_64-report.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=555041 responseStatus=201 Created token=EALyV-jV
ERROR: Job failed: exit code 1
failed
G_DISABLE_ASSERT Build
_build/config.h: found 1 matching files            
_build/glib/glibconfig.h: found 1 matching files

_build/meson-logs: found 4 matching files

_build/G_DISABLE_ASSERT-report.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=555044 responseStatus=201 Created token=TqWKEzUG
Uploading artifacts...
_build/G_DISABLE_ASSERT-report.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=555044 responseStatus=201 Created token=TqWKEzUG
ERROR: Job failed: exit code 1
failed
vs2017-x64 Build
_build/meson-logs: found 2 matching files          
WARNING: _build/vs2017-x64-report.xml: no matching files
WARNING: Failed to load system CertPool:crypto/x509: system root pool is not available on Windows
Uploading artifacts to coordinator... ok
id=555049 responseStatus=201 Created token=FUTk7fKU
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=2044 revision=de08a4bb version=11.9.1
WARNING: _build/vs2017-x64-report.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
style-check-diff Style Check
 }

int
-main (int argc,
+main (int argc,
char *argv[])
{
g_test_init (&argc, &argv, NULL);
ERROR: Job failed: exit code 1