Tesla’s drive to keep plant open irked city that saw health risk