Uses defer and listens for SIGTERM As well as doing some other nice cleanup. This will also no longer leave backup files in the mw directory which is nice :) Bug: T291529
For now we don't need this, and we can always add it back later
Had an extra $ that was missed and not needed
This was prep work for maybe taking a look at T284227
This is now fully handeled by the docker daemon on the gitlab runner instead...