Implement host_write for write file with semihosting