fanotify: generalize merge logic of events on dir