udf_file_write_iter: reorder and simplify