fix(controller): update App.structure field correctly after scaling

While the scaling logic is correct, we were naively using the requested
scaling values to update the App.structure JSON field, rather than the
actual containers in existence after scaling. This was cosmetic only,
but is fixed by a SQL aggregate query and python dict comprehension.
Includes regression unit tests.
Merge pull request #2672 from mboersma/fix-app-structure-save

fix(controller): update App.structure field correctly after scaling