Fixed a race condition when a job is picked up by 2 workers
Allow apps to be scaled down or stopped when the quota is lowered.

Fix: 52843321. User should be able to stop or scale down an app after quota is lowered.
Before the fix, when quota is lowered, memory requested always returned 0 and thus making it larger than memory remaining.
This fix allows app to be scaled down if memory is reduced below the memory remaining.
This fix allows app to be stopped without raising an error.