Simultaneous stabilization and control of the n = 1 and n = 2 resistive wall mode