Long internal waves in shear flows: topographic resonance and wave-induced global instability