Enhancing Traffic Safety with AI and 6G: Latency Requirements and Real-Time Threat Detection