One person has been killed and another is in custody after a possible terror attack at a factory in France, a local official says.