core: unify how we iterate over inotify events

Let's add some syntactic sugar for iterating through inotify events, and
use it everywhere.

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>