Transverse dynamic stabilization of a theta pinch