Kurdyka-Lojasiewicz-Simon inequality for gradient flows in metric spaces