Fixed pyinotify performance regression in 15f82c7011

Fixes again #9722.