On the stability of a heterogeneous shear layer subject to a body force