Simplifies the file-based lock mechanism and fixes the race condition
Simplifies the file-based lock mechanism and fixes the race condition

No need to write to, or unlink the lock file. Rely on kernel-level
file locking mechanisms (fcntl) instead. The lock will be held for the duration
of the process.

Locking will always fail if another process has locked the file. Unlocking
can be done explicitely, but will also always happen implicitly at process
termination.

Tivix/django-cron