fix(upgrade): fixes erroneous values in the list of processed upgrades

Code in the upgrade includes was overwriting variables in the upgrade service
resulting in an object being saved to the list of processed upgrade where the
filename should have been. This upgrade replaces the class with the filename and
isolates the scope of the include so upgrades cannot break the process.

Fixes #7198.
@xavgra2 yes it would be very helpful if you could checkout the fix_7198 branch of my fork, and run upgrade.php again. The changes we've applied here should (we hope) clean up the problem.