When creating a new file lock, we need to check if the containing
directory can be written, not if the file (which may not yet exist) can
be written
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14942
wxSingleInstanceChecker is meant for running programs, not file locking.
This implements an RAII class for file locking that stores the lock
files next to the file being locked, allowing it to be easily found and
removed. Also includes the ability to override the lock, with
information about the original owner
Fixes https://gitlab.com/kicad/code/kicad/-/issues/14734
The global ::LockFile() function is used in a single place, but it's in
common.h, so visible to all files.
The GetKicadLockFilePath function is used in only two places, and one of
them is LockFile.
This commit puts them both in a separate header, so they're only visible
to code using them.
The implementation of GetKicadLockFilePath is moved to lockfile.cpp,
where LockFile already was.
Also removed a (large) handful of wxT macros, which aren't needed any
more and make code less readable.