Implementation for process / thread locking using lockfile.