This is not a real answer, but as a workaround:
Move the directory to a subdirectory specific to your application, which is on the same volume.
Advantages:
- Prevents users and other programs from modifying the file at the old location, as the files will no longer be there
- Importantly, will fail if a process already has a file open within that directory, thus ensuring that the "acquired" lock is indeed "exclusive"
Disadvantages:
- It's a hack
- The software will need to be adapted to work with the directory at a different path than where it was initially
- Users and programs attempting to access the files will encounter unusual behavior or errors ("Path not found" instead of "Access denied")
- Does not protect against programs that may poke into your application-specific subdirectory
- Will leave the directory "locked" (moved to a location the user probably can't find) if your program crashes while the "lock" is "held"