Provide debug hooks to track the file system monitor state.
Imported from https://youtrack.roxen.com/issue/PIKE-17
Reported by @grubba
Tracing of the file system monitor system is currently provided via the -DFILESYSTEM_MONITOR_DEBUG option, which simply tracks all operations. This is useful, but is hard to use as interesting information has a tendency to drown in other data.
Add an API to make it possible to get more fine-grained filtering of the trace.