Energy-stable discretization of the one-dimensional two-fluid model