When reading and writing tempfiles, don't overrun our committed-to length.