Improve robustness of test-temp-file-expiry