Simplify temp directory handling in tests