Protect Before Generate: Error Correcting Codes within Discrete Deep Generative Models