A Variational Principle Applied to the Dynamics of a Liquid with Diffusing Gas Bubbles