Destructor handling issues with internal generated temporary variables

During bug 11311 fix, I found some similar dtor-handling issues related with internal generated temporaries.
These are not regressions, because they had not worked yet correctly.
However, bugfix for 6178 is done in 2.064alpha, so I want to fix these problems in 2.064 release.

See also commit log messages for the details.