Store layers with pending frames as smart pointers instead of raw pointers

Layers can be removed in between invalidations, which is problematic
when using raw pointers. Instead, store a set of sp<Layer> with a custom
hash

Bug: 170729573
Test: builds
Change-Id: I87dd48a7767b8c05461cb4e56b3fbcd037d0603e
2 files changed