in truncate.t, close $tmpfile before opening again

Resubmit of RT-96609 including the submitted patch.