Fix potential freezer thrashing

Currently a pending DO_FREEZE message stays in the message queue until
AMS tries to actually freeze it. If the OOM_ADJ happens to swing back
and forth, the app might be frozen and then unfrozen quickly. Fix the
issue by removing the pending DO_FREEZE message ASAP.

Bug: 188739027
Test: Move an app to foreground, its pending freeze status is cleared.
Change-Id: I369710d408e1d81bc169a620543909cb4ae6edf7
3 files changed