Thermodynamic origin of instability in hybrid halide perovskites