track inotify watches added by the process

and provide a function to remove them all, possibly before process exit.

ref: Bug #100770
Cleanup is a more appropriate name here
Merge remote-tracking branch 'origin/v2.10.6-bug100770-inotify-leak' into release-v2.10-patches