AGrail: A Lifelong Agent Guardrail with Effective and Adaptive Safety Detection