Reset the database lock if pid changed