Delete lockfile only after all activities stopped