Add EOF handling to 'read_all' function in the io module, and TCTIs.

This fixes a possible infinite loop in the TCTIs if / when the other end
of the IPC mechanism shuts down (for whatever reason). We add tests for
this scenario to the unit test for the io module.

Additionally the device and mssim TCTIs now handle this situation and
unit tests added for this scenario too.

Signed-off-by: Philip Tricca <flihp@twobit.us>
diff --git a/Makefile-test.am b/Makefile-test.am
index b51db52..af93dd4 100644
--- a/Makefile-test.am
+++ b/Makefile-test.am
@@ -170,8 +170,8 @@
     src/tss2-tcti/tcti-mssim.c src/tss2-tcti/tcti-mssim.h
 
 test_unit_io_CFLAGS  = $(CMOCKA_CFLAGS) $(TESTS_CFLAGS)
-test_unit_io_LDADD   = $(CMOCKA_LIBS) $(libutil) $(libtss2_mu)
-test_unit_io_LDFLAGS = -Wl,--wrap=connect,--wrap=socket,--wrap=write
+test_unit_io_LDADD   = $(CMOCKA_LIBS) $(libtss2_mu) $(libutil)
+test_unit_io_LDFLAGS = -Wl,--wrap=connect,--wrap=read,--wrap=socket,--wrap=write
 test_unit_io_SOURCES = test/unit/io.c
 
 test_unit_CommonPreparePrologue_CFLAGS = $(CMOCKA_CFLAGS) $(TESTS_CFLAGS)