lock_file(): exit early if lockfile cannot be opened