lib/core: add blocking eof implementation
eof is a problematic operation for Streams as its state may be decided
by reading input (in sockets for instance).
Because of that, operations relying on it may read one extra byte at the
end of a file, causing the apparition of bad characters (null byte, or
replacement character).
By changing the semantic of eof and making it blocking, we ensure that
querying eof will always produce the appropriate error.
Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>