Two issues in AMRMProxy:
1. When application finishes, AMRMTokenSecretManager is not updated to remove related data, leading to memory leak.
2. When we kill an application, we should remove the pipeline after the AM container is killed.
FINISH_APPLICATION event is sent when the AM container is still being killed. After we remove the pipeline, we might still get heartbeats from AM, triggering exception messages.
Instead, we should wait for APPLICATION_RESOURCES_CLEANEDUP event, sent after where the AM container is killed.