Learning Shared Safety Constraints from Multi-task Demonstrations