events: Enable compile-time warnings as errors Also fix issues reported by SonarQube and other small nits. Change-Id: I4f4a12302d5907b5a65bf38a67dd186195517f76