Safety Metrics and Losses for Object Detection in Autonomous Driving