Fix communication with the file monitor thread.