Fixed pyinotify performance regression in 15f82c7011

Refs #9722. Thanks Tim Graham for the review.