Thermodynamic nature of the 0–pi quantum transition in superconductor/ferromagnet/superconductor trilayers