Force between the plates of a plane capacitor in a fluid: a rigorous thermodynamic analysis