[3.5.x] Fix stack corruption when calling VerifyEnvironmentsPromise().

(cherry picked from commit c9de9e82273eff22be85d3be547c1b10c5fbf3c2)