udf: avoid unnecessary synchronous writes