[fix] Include app instances in memory quota checks

This commit fixes a bug where number of instances of an app was not
taken into account when computing the total memory consumed by the app.
This caused memory quota check for the org to be erroneous.

Change-Id: I4a7171292e41e2c438daf82b21fbd439bce1cef8