The file system example code is not currently thread safe. It is a known issue, that causes occasional Jenkins test failures.
We should resolve the issue. It's a bit tricky since we want the examples to be cross-platform and we don't want to include internal WiredTiger files in our example code. If it was a matter of including a single source file from WiredTiger (e.g: lock.h), including an internal file might be a reasonable solution.