Brain Mechanisms for Learning and Using Safety Signals