Thermodynamic approach to accurately determine pressure profiles for metal-organic frameworks to assess their flexibility and loss of crystallinity