Towards Safer Generative Language Models: A Survey on Safety Risks, Evaluations, and Improvements