Generalized Bell inequalities and frustrated spin systems