Clear lockfile properly