Fix stale lockfile handling