r23977: Im prove the pwrite-patch to tdb_expand_file of r23972: