SMS dit: Long Live TIME: Improving Lifetime and Security for NVM-Based Training-in-Memory Systems