The thermodynamics of the quark-hadron phase transition in the early universe