Fix AWS::StackId pseudo-parameter during stack update

Parameters, including pseudo-parameters, are resolved at the time that
resources are created, which is as soon as they are first accessed (in the
case of a stack update, this means during the validation of the new
template). As a result, by the time we set the AWS::StackId
pseudo-parameter in the process of doing an update it is already too late
for resources in the new stack to resolve them correctly. This was leading
to spurious differences being detected on stack update.

This patch fixes the issue by setting the pseudo-parameter before any
resources in the new stack are created.

Fixes bug 1260282

Change-Id: I908879827d6460ecbef30e9db98ac5597dc323cd
Merge "Fix AWS::StackId pseudo-parameter during stack update"