SIGN IN SIGN UP

Fix PartGenerator token request while creating tmp file

Prior to this commit, the `PartGenerator` would allow requesting
additional part tokens while in the `CreateFileState`. This is invalid
as any new token emitted would be rejected and would fail the entire
process.
This would only happen if the tmp file creation is slow enough for a new
token to be parsed and emitted.

This commit ensures that no new part token is requested while creating
the temporary file.
This change also fixes lifecycle issues and ensures that buffer
resources are cleaned in case of errors.

Fixes gh-36694
B
Brian Clozel committed
952198b2ee1f73ea8012a60a9968679e639be127
Parent: 8d93670