Safety-Driven Deep Reinforcement Learning Framework for Cobots: A Sim2Real Approach