fix #273: fix logical issues in adding/removal of file watchers