Make file_watcher thread safe