The Task Shield: Enforcing Task Alignment to Defend Against Indirect Prompt Injection in LLM Agents