Verified Synthesis of Optimal Safety Controllers for Human-Robot Collaboration