libhwc2.1: unregister RRI handler before resetting the pointer

In Ic620f0062a285e66a2918236bc820faa1a69e761, the unregistering of
handler from polling was moved into the destructor of the handler. But,
this would make the destructor to never be called because we still have
another handler pointer in DrmEventListener. So the reference count
would never become 0 if we don't unregister the handler first.

Bug: 315324508
Test: enable & disable refresh rate indicator, make sure fd is closed
Test: VtsHalGraphicsComposer3_TargetTest
Change-Id: Ib510021e55be0ca83dec2cd63483f1c788269e9c
2 files changed