io: always return all bytes received as written