A Risk-Based Approach to Machine Protection Systems