Biogenesis by cometary grains — Thermodynamic aspects of self-organization