[flashrom] Restructure shutdown functions and remove global state