logd: throttle SELinux denials to 20/sec

Impose a limit of 20 selinux denials per second. Denials beyond
that point don't add any value, and have the potential to cause
crashes or denial of service attacks.

Do some other misc cleanup while I'm here.

Bug: 18341932

(cherry picked from commit c234a1b879d9c9d8e1a797c5dcf3098249945748)

Change-Id: Ic5c96003db82e504baf301e87be5c8c539c73c2a
3 files changed