Analysis of water in liquid and solid samples by headspace gas chromatography