The stability of ideal magnetohydrodynamic ballooning modes in plasmas with internal transport barriers