Two-layer interfacial flows beyond the Boussinesq approximation: a Hamiltonian approach