Move listener registration/unregistration to onResume/onPause

Apparently onDestroy isn't *always* called, and Xposed Installer was
FCing on my device because of that (listener raises an NPE) apparently.
This commit should fix it.