Backport Bug 2040704: Fix date format leak in Firefox 151

New leak in 151 found by Thorin: https://bugzilla.mozilla.org/show_bug.cgi?id=2028170

I opened a regression bug upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=2040704

If upstream doesn't fix this soon, we might want to do it.