[Filesystem] fix lock file permissions

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12589, #12634
| License       | MIT
| Doc PR        | -

This PR replaces #12634. It tunes permissions on lock files so that locking is allowed for any OS user.