Merge pull request #1463 from parasol-aser:fix/copystat-toctou-1461

PiperOrigin-RevId: 909898919