Revert !6485 (merged). The change broke cases using
multiple successful custom commands. Revert it pending further
investigation into the interaction of the generated script code with
Microsoft.Common.CurrentVersion.targets, and whether this is needed
for all managed projects or just C# projects.
Also add a test covering the case that was broken.