Unified Defense for Large Language Models against Jailbreak and Fine-Tuning Attacks in Education