Safe Control for Soft-Rigid Robots with Self-Contact using Control Barrier Functions