Fix stack corruption when calling VerifyEnvironmentsPromise().
(cherry picked from commit c9de9e82273eff22be85d3be547c1b10c5fbf3c2)
Merge pull request #1013 from kacfengine/3.5.x

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