Remove FFI generated null character from write