Optical analysis of thin-layer electrochemical cells for infrared spectroscopy of adsorbates