Learning Control Policies for Fall Prevention and Safety in Bipedal Locomotion