io: Implement IWriteFile

Mirrors CReadFile
This implementation is not tested yet, however, I don't see why it
wouldn't work.