core/io: introduce flush() call for ByteIO