Inertial instability in two-layer flows